Remove use of global 'reds' variable from QXLState functions.
Instead store the owning RedsState variable inside the QXLState
struct and use that when necessary.
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Considering that:
- QXLState is the state of QXLInstance implementation;
- RedDispatcher is the implementation of QXL;
- qif (QXLInterface*) field can be computed really easy from QXLInstance;
- most of its state is private.
Make all structure private and use QXLState instead of RedDispatcher.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
RedDispatcher is basically implementing QXLInstance.
After some internal discussion we decided to use QXLState structure
and red_qxl_ as function prefix.
This is the first of 3 patches that rename functions, structure
and files.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Avoid to include headers in cursor-channel.h which are only
used by cursor-channel.c
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
These methods wrap the RedsCoreInterface::watch_add,
RedsCoreInterface::watch_remove and RedsCoreInterface::watch_update_mask
vfuncs.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Apparently, after using g_option_context_parse with G_OPTION_REMAINING
argv is modified and should not be used.
This patch uses "file" instead of "argv" and makes sure
file is freed later.
No free is called upon error - exit takes care of it.
It has the same lifetime as the corresponding structure so this
simplifies keeping track of it.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
The first part updates the .gitignore file in the root directory
because the file is obviously generated by automake but poison
our working tree.
The second part updates the .gitignore under server/tests/
directory because since 0db1137d we have a noinst test library
libtest.a. However, like in previous case, git should never track
this file.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
After 7a06efde we require SPICE_MSG_DISPLAY_GL_SCANOUT_UNIX
symbol from spice-protocol (or value to be more precise). This
has been however introduced in version 0.12.11 of the
spice-protocol (commit 3fc2221e there). However, our configure
check does not reflect this change. Fix it.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Was possible to have ping_timer_cb called with a NULL pointer.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Patch 1f21008060 ("Remove use of global
'reds' from AgentMsgFilter") introduced a regression. This because
QXLInterface->client_monitors_config was called before returning
from spice_add_interface. Some client of spice-server expect the
spice_add_interface already returned and some state change was done
before client_monitors_config was called.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Remove version_string variable.
Was never changed and used in a single place.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Rename this struct to make it clear that it's only the base class for
graphics channels (e.g. display and cursor), not all channels.
Also renamed CommonChannelClient to CommonGraphicsChannelClient.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Rules are now:
Compression type:
off -> uncompressed
quic -> jpeg if possible else quic else off
lz -> lz if possible else off
glz -> glz if possible else lz else off
auto_lz -> lz if possible else jpeg else quic else off
auto_glz -> glz if possible else lz else jpeg else quic else off
lz4 -> lz4 if possible else lz else off
jpeg is used only when jpeg-wan-compression allows it
Acked-by: Frediano Ziglio <fziglio@redhat.com>
The structure is strictly used by the parser only, no reason to make it
public.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
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>