Initialize global images at load time:
- make sure these stuff are initialized without using runtime
resources;
- make sure stuff are initialize really earlier.
Do not use atexit function but a destructor.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
QXLWorker is the old interface now completely deprecated.
Remove the strict dependency of having it as a base class.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
All other messages (even empty ones) have a structure defined.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This should be the final piece of removing the global reds variable. We
still need a global variable to clean up during the atexit() function,
but we use a GList of servers (even though we technically don't support
multiple servers in the same process yet).
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Add helper functions wrapping calls to the virtual functions
defined in SpiceCharDeviceCallbacks.
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This makes it easier to move the VDIPort API to a different file, and
make it as self-contained as possible.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
AgentMsgFilter needs to know whether monitors config messages need to be
filtered or not. This used to be done from within
agent_msg_filter_config() using the global RedsState, but this got more
tricky as it was removed.
A first attempt a1e62fa5ae caused crashes on qemu startup with
"qemu-system-x86_64 -spice port=5900" (without -vga qxl). A second
attempt added a RedsState* argument to agent_msg_filter_config() which
in my opinion is not really nice from a layering point of view.
This new attempt makes sure AgentMsgFilter state is correct when the
filter is set to stop discarding all data, which allows to remove direct
use of RedsState from within AgentMsgFilter.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Passing Reds into agent-msg-filter.[ch] isn't the right thing to do from
a layering point of view.
This reverts commit a1e62fa5ae.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
It's always called at the same time as red_channel_register_client_cbs()
and the data is used by the callbacks, so we can pass the data as an
argument to red_channel_register_client_cbs().
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Add red_qxl_ methods wrapping the QXLInterface vfuncs. This allows to
remove most of the qxl_get_interface() use outside of red-qxl.c
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This seems to make more sense this way, QXLInstance is the 'main' object
with QXLState being its private data. External users then use QXLInstance
rather than passing a pointer to the private data to red-qxl.h methods.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Note that the commands are executed by spice-server.
The "skip" is only done on the "sleep" part of the
"slow" command-line option.
This is helpful to run quickly through uninsteresting commands
in a beginning of a recorded file and going slowly when
interesting parts appear
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This public API is no longer needed as the keepalive interval does not
need to be configurable.
This API was present in the 0.13.0 release, but was never added to a
stable release, in my opinion it's still acceptable to remove it without
changing soname.
Pick codegen build fix (codegen is back in spice-common, see related
commits & discussion thread)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
APDUBufSize is only used within smartcard.c, no need to expose it in
smartcard.h
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
The RedChannel argument is not used by pipe_item_init. Removing it
will make code simpler in places where we don't have a RedChannel
directly available.
This is acting on a PipeItem object so correct name is pipe_item_init.
Acked-by: Pavel Grunt <pgrunt@redhat.com>
The code was introducing an intermediate RedsMigWaitDisconnectClient type to
hold linked list elements, resulting in a memory handling behaviour very
similar to a GList. Using GList directly makes the code shorter and more
readable.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
The code was introducing an intermediate SpiceCharDevStateItem type to
hold linked list elements, resulting in a memory handling behaviour very
similar to a GList. Using GList directly makes the code shorter and more
readable.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
st field in QXLInstance was not checked for NULL before
initialisation.
The additional check make Xspice crash during startup.
Reported-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Commit e9ed125d introduced a dead-lock regression by taking twice the
same lock recursively. The previous code checked if a dmabuf was set
without taking the lock, for queuing scanout messages. Since the message
is being processed later on, it make sense to queue and delay until it
is sent to check if there is a scanout.
backtrace:
#0 red_qxl_get_gl_scanout (qxl_state=0x5555582373c0) at red-qxl.c:828
#1 0x00007fffec1ae654 in marshall_gl_scanout (rcc=0x7fffda6a7010,
#m=0x7fff44025e60, item=0x7fff440958a0) at dcc-send.c:2310
#2 0x00007fffec1aec7b in dcc_send_item (dcc=0x7fffda6a7010,
#pipe_item=0x7fff440958a0) at dcc-send.c:2441
#3 0x00007fffec1730f6 in send_item (rcc=0x7fffda6a7010,
#item=0x7fff440958a0) at display-channel.c:1963
#4 0x00007fffec1504c3 in
#red_channel_client_send_item (rcc=0x7fffda6a7010, item=0x7fff440958a0)
#at red-channel.c:578
#5 0x00007fffec152d98 in red_channel_client_push (rcc=0x7fffda6a7010)
#at red-channel.c:1365
#6 0x00007fffec1a387e in dcc_push_monitors_config (dcc=0x7fffda6a7010)
#at dcc.c:563
#7 0x00007fffec1a3489 in dcc_start (dcc=0x7fffda6a7010) at dcc.c:475
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Get the server variable from the QXLState instead of using the
global variable
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
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>