Commit Graph

2601 Commits

Author SHA1 Message Date
Frediano Ziglio
742612f34d Rename SpiceCharDeviceCallbacks to RedCharDeviceCallbacks
The structure is an internal one so should not have the Spice prefix
but use the Red one.

Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-04-01 14:33:54 +01:00
Christophe Fergeau
b248815119 doc: Be more explicit about virgl requirements
This is an attempt at listing the versions of the various packages which
needs to be up to date for a functional virgl + spice.
2016-04-01 15:16:44 +02:00
Christophe Fergeau
26f874e738 mjpeg: Add missing space to debug string 2016-04-01 15:16:27 +02:00
Christophe Fergeau
281eeed189 build-sys: Update libtool versioning for 0.13.1 2016-04-01 15:16:27 +02:00
Christophe Fergeau
80832dd17e Update NEWS for 0.13.1 2016-04-01 15:16:24 +02:00
Jonathon Jongsma
a24ebcae89 Rename RedCharDevice functions
make the function names match the type names. So
spice_char_device_state_* becomes red_char_device_* and
spice_char_device_* also becomes red_char_device_*.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-04-01 11:59:46 +01:00
Jonathon Jongsma
0fd5b56be7 Rename SpiceCharDeviceClientState to RedCharDeviceClient
Make it consistent with the renamed RedCharDevice and the convention of
using 'Red' namespaces for internal types

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-04-01 11:59:44 +01:00
Jonathon Jongsma
b693eae580 Rename SpiceCharDeviceState to RedCharDevice
This is more consistent with internal type naming convention, and it
paves the way for a new char device GObject heirarchy

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-04-01 11:59:43 +01:00
Jonathon Jongsma
f3028e9ada Rename SpiceCharDeviceWriteBuffer to RedCharDeviceWriteBuffer
Internal types should use 'Red' namespace for consistency

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-04-01 11:59:40 +01:00
Jonathon Jongsma
f02b66a225 Rename SpiceCharDeviceMsgToClient to RedCharDeviceMsgToClient
Internal types should use Red namespace for consistency

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-04-01 11:59:33 +01:00
Christophe Fergeau
fe3d5d542d char-device: Avoid use-after-free
Reset pointer after freeing the structure pointing to it.

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-03-31 08:07:52 +01:00
Christophe Fergeau
61d41688d4 smartcard: Prepare to turn SmartcardState into a GObject
Move all internal data into a private struct so that it won't be exposed
when we move SmartCardDeviceState into the header.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-03-30 17:59:59 +01:00
Jonathon Jongsma
5c55955ade Convert Dispatcher and MainDispatcher to GObjects
Allows more explicit inheritance relationship, and numerous other
advantages.

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-30 17:19:24 +01:00
Christophe Fergeau
8e614edd0f char-device: Move instance data to SpiceCharDeviceState::priv
Create a structure to hold private data.
This helps to make patch for GObject smaller.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-29 10:09:09 +01:00
Frediano Ziglio
4c5c9f6b69 dispatcher: move channel final initialization to red-worker
CursorChannel and DisplayChannel was initialized half in red_worker_new
and half in red_dispatcher_init using some accessor for RedWorker
(red_worker_get_cursor_channel and red_worker_get_display_channel).
Moving directly into red_worker_new make easier to follow code path.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-29 09:26:23 +01:00
Frediano Ziglio
8b1e31c2e7 qxl: use Dispatcher in channel callbacks
There is no need callbacks knows about internal QXLState.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-24 15:38:56 +00:00
Francois Gouget
3486ecde03 server: More clearly identify channels that support multiple clients
Rename the function to channel_supports_multiple_clients() as
channel_is_secondary() is unclear and was coded to return the opposite
of what was originally intended.
Also there are few channel types and whether they support multiple
clients is totally static so we might as well delegate the check to
the compiler.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-03-24 15:19:38 +01:00
Frediano Ziglio
5e15934dce do not compile dump_bitmap if not necessary
This function is used only for debugging

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-03-24 13:11:46 +00:00
Christophe Fergeau
782c7508e2 doc: Add virgl documentation
Document how to use virgl with QEMU/libvirt

virt-manager documentation still needs to be added.
2016-03-24 13:56:59 +01:00
Frediano Ziglio
6aaca6cf24 make some functions static
No need to have callback registered internally no static

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-03-24 12:55:42 +00:00
Frediano Ziglio
f34779dc9c removed unused red_qxl_set_mm_time
This helper call a deprecated callback.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-03-24 12:50:56 +00:00
Frediano Ziglio
ee4b8a1480 remove unused reds_set_mm_time
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-03-24 12:48:38 +00:00
Frediano Ziglio
44a97b6095 use constructor/destructor macros
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>
2016-03-23 16:31:02 +00:00
Frediano Ziglio
088add2b98 qxl: implement QXLWorker interface, do not use as a base class
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>
2016-03-23 14:30:07 +00:00
Frediano Ziglio
5c48cdc61d declare and use message for RED_WORKER_MESSAGE_GL_SCANOUT
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>
2016-03-23 14:09:53 +00:00
Frediano Ziglio
c51f1126eb build-sys: use safer SPICE_CONTAINEROF version
Enable additional checks for this macro.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-23 13:44:22 +00:00
Jonathon Jongsma
4f6c1765c7 Remove last usage of global 'reds' variable
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>
2016-03-23 08:21:57 +00:00
Christophe Fergeau
5981cf2645 char-device: Add helpers for SpiceCharDeviceCallbacks vfuncs
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>
2016-03-22 10:29:39 +00:00
Christophe Fergeau
4bf53c23d8 Remove dependency of vdi_port_read_buf_process on RedsState
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>
2016-03-21 10:34:31 +00:00
Christophe Fergeau
0df59fcfc9 agent: Sync AgentMsgFilter state upon agent connection
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>
2016-03-21 10:34:29 +00:00
Christophe Fergeau
79e02e98ab Revert "fix regression due to callback called earlier"
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>
2016-03-21 10:34:22 +00:00
Christophe Fergeau
722ad4c76b Remove red_channel_set_data()
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>
2016-03-17 18:54:52 +00:00
Christophe Fergeau
fe9977c469 Use red_qxl_check_qxl_version in red-worker
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-17 16:26:58 +00:00
Christophe Fergeau
ae931c7dab Add more red_qxl_ methods
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>
2016-03-17 16:26:56 +00:00
Christophe Fergeau
e45ab9cf23 Use QXLInstance instead of QXLState in red_qxl_*
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>
2016-03-17 16:26:33 +00:00
Francois Gouget
768ec149db server: Add some comments to the sound structures.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-03-16 16:36:52 -05:00
Francois Gouget
5bb27f240b server: Give the SndChannel's ref and unref methods their expected name
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-03-16 16:36:48 -05:00
Uri Lublin
2480eb6979 replay: skip the first N (slow) commands
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>
2016-03-16 10:09:07 +00:00
Uri Lublin
07cb94d7ab replay: count commands
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-16 10:08:48 +00:00
Christophe Fergeau
3ae8ce38a1 Use more explicit variable name in marshall_gl_scanout()
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-15 21:36:10 +00:00
Christophe Fergeau
a33f874249 Fix typo in variable name in function prototype
num_common_cap rather than num_common_caps was not consistent with
the naming of the other arguments.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-15 21:36:07 +00:00
Christophe Fergeau
aa87700682 Remove unused red_qxl_set_dispatcher_opaque
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-15 21:33:10 +00:00
Christophe Fergeau
4c1471d0b6 Remove spice_server_set_keepalive_timeout
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.
2016-03-11 18:27:51 +01:00
Christophe Fergeau
7199ce961a Always enable TCP keepalive
Always enabled, hardcoded interval
as per https://bugzilla.redhat.com/show_bug.cgi?id=1298590
2016-03-11 18:27:51 +01:00
Marc-André Lureau
264a80264a Update spice-common
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>
2016-03-11 12:58:11 +01:00
Christophe Fergeau
23d328f713 smartcard: Move private constant to C file
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>
2016-03-10 11:52:52 +00:00
Christophe Fergeau
a653044011 Rename red_channel_pipe_item_init to pipe_item_init
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>
2016-03-10 11:36:52 +00:00
Christophe Fergeau
3484b739a9 char-device: Refactor spice_char_device_client_add a bit
Factor out CharDeviceClientState creation out of
spice_char_device_client_add.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-10 10:48:11 +00:00
Christophe Fergeau
91bab2ff1c Replace RedsPrivate::mig_wait_disconnect_clients with a GList
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>
2016-03-09 17:33:53 +00:00
Christophe Fergeau
30f718aae2 Replace RedsPrivate::char_devs_state with a GList
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>
2016-03-09 17:33:49 +00:00