Was not used by CursorChannelClient but only by DisplayChannelClient.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
The 'port' argument can be determined from VDIPortState, so no need to
pass both (through RedsState) to vdi_port_read_buf_process().
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Pass RedsState variable to snd_attach_(playback|record) and get a
reference to this variable when needed by various functions.
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Requires changing a bunch of internal API to take MainDispatcher
arguments, etc. The main dispatcher object is now owned by RedsState,
since that is the object that previously created (initialized) it.
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Allows us to remove use of global 'reds' variable from reds-stream.c.
Requires changing the RedsStream constructor to accept a RedsState arg.
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Since these are server-level variables, move them into RedsState.
However, num_active_workers was removed because:
- each dispatcher always has 1 active worker, so we can determine the
number of active workers by counting the dispatchers
- it was never actually set correctly. Even if there was more than one
worker, this variable was always only set to either 0 or 1.
This change required moving a bunch of helper code into RedsState as
well, an providing some RedDispatcher interfaces to access dispatcher
information from RedsState.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Instead of using list in RedDispatcher (which is going to be removed)
use the one in RedsState.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
This duplicate the other list which will be removed
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
They are now carried in the appropriate command through
QXLReleaseInfoExt, so we don't need to pass them around explicitly.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Now it no longer needs external state in order to destroy the
RedDrawable instance when needed, so we can remove this from the
prototype.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Storing a QXLReleaseInfoExt rather than a QXLReleaseInfo in RedDrawable
gives us a place to store group_id for free. Since we are building a
QXLReleaseInfoExt from QXLReleaseInfo and group_id when destroying a
RedDrawable instance, this is a move in the right direction.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
It's only used in a few debug printfs. If we want these stats, we'll
have to find a better way than forcing a dependency on a high-level
class in a lower-level _unref method just to maintain the stats.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Was causing sporadic crashes.
Also cause compatibility problems with RHEL 6.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Check that cancelling a timer the timer callback is not called.
This can happen in latency code (red-channel.c).
In red_channel_client_cancel_ping_timer latency timer is cancelled and
state is set to PING_STATE_NONE however if timer was already active what
happens is that the red_channel_client_ping_timer is called and the line
spice_assert(rcc->latency_monitor.state == PING_STATE_TIMER);
is triggered causing spice-server to abort.
This happens as GLib loop add all active sources to an array but if the
timer is deactivated before the event is dispatched the event will be
dispatched unless the source is destroyed.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Add RedsState arg to main_channel_new(), and use the 'reds' property
that is stored in the base RedChannel struct rather than the global
'reds' variable.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
These automatic variable are used just inside the function.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
CommonChannel does not need to know about RedWorker.
This reduce a bit dependencies between objects.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
The only usage of this ring was to have a message when there was no
commands on the list.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>