spice/server
Frediano Ziglio ba175f9be1 channel: add interface parameters to SpiceCoreInterfaceInternal
This patch and previous ones want to solve the problem of not having a
context in SpiceCoreInterface. SpiceCoreInterface defines a set of
callbacks to handle events in spice-server. These callbacks allow to
handle timers, watch for file descriptors and send channel events.
All these callbacks do not accept a context (usually in C passed as a
void* parameter) so it is hard for them to differentiate the interface
specified.
Unfortunately this structure is used even internally from different
contexts for instance every RedWorker thread has a different context. To
solve this issue some workarounds are used. Currently for timers a variable
depending on the current thread is used while for watches the opaque
parameter to pass to the event callback is used as it currently points just
to RedChannelClient structure.  This however imposes some implicit
maintainance problem in the future. What happens for instance if for some
reason a timer is registered during worker initialization, run in another
thread? What if we decide to register a file descriptor callback for
something not a RedChannelClient?  Could be that the program will run
without any issue till some bytes change and weird things could happen.

The implementation of this solution is done implementing an internal "core"
interface that has context specific and use it to differentiate the
context instead of relying on some other, hard to maintain, detail. Then an
adapter structure (name inpired to the adapter pattern) will provide the
internal core interface using the external, public, definition (in the
future this technique can be used to extend the external interface without
breaking the ABI).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-01-11 16:40:17 +00:00
..
tests channel: add a new internal SpiceCoreInterface 2016-01-11 16:29:53 +00:00
.gitignore Update the .gitignore files for the new manual, 2015-10-16 15:48:23 -05:00
agent-msg-filter.c server: rename files 2015-12-03 23:54:32 +00:00
agent-msg-filter.h server: Add support for filtering out agent file-xfer msgs (rhbz#961848) 2013-06-06 16:07:30 +02:00
cache-item.h server: rename files 2015-12-03 23:54:32 +00:00
cache-item.tmpl.c server: rename _tmpl files 2015-11-26 13:33:36 +00:00
char-device.c channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
char-device.h server: rename files 2015-12-03 23:54:32 +00:00
cursor-channel.c server: Rename DISPLAY_CLIENT_TIMEOUT and de-duplicate it 2015-12-14 10:53:40 +00:00
cursor-channel.h server: rename files 2015-12-03 23:54:32 +00:00
dcc-encoders.c dcc: write and use a new encoder_data_reset function to clean buffers 2016-01-08 16:25:37 +00:00
dcc-encoders.h dcc: write and use a new encoder_data_reset function to clean buffers 2016-01-08 16:25:37 +00:00
dcc-send.c dcc: do not cause problem with multiple threads. 2015-12-11 14:57:05 +00:00
dcc.c dcc: avoid to report errors triggered by client 2016-01-11 14:45:02 +00:00
dcc.h server: Add time constants to go with spice_get_monotonic_time_ns() 2015-12-14 11:24:34 +00:00
demarshallers.h Remove trailing blank lines 2012-01-13 18:11:59 +02:00
dispatcher.c dispatcher: Remove unused dispatcher_read_message 2015-11-23 11:45:20 +00:00
dispatcher.h server: misc header cleanups 2015-12-09 22:17:51 +00:00
display-channel.c stats: use CLOCK_THREAD_CPUTIME_ID for cpu statistics 2016-01-11 16:29:08 +00:00
display-channel.h server: Remove an unneeded mjpeg-encoder.h include 2015-12-15 17:48:58 +00:00
display-limits.h worker: start a DisplayChannelClient unit 2015-11-19 12:43:02 +00:00
glz-encode-match.tmpl.c server: rename _tmpl files 2015-11-26 13:33:36 +00:00
glz-encode.tmpl.c server: rename _tmpl files 2015-11-26 13:33:36 +00:00
glz-encoder-dict.c remove glz_encoder_config.h 2015-12-04 11:57:18 +00:00
glz-encoder-dict.h remove glz_encoder_config.h 2015-12-04 11:57:18 +00:00
glz-encoder-priv.h server: misc header cleanups 2015-12-09 22:17:51 +00:00
glz-encoder.c server: rename files 2015-12-03 23:54:32 +00:00
glz-encoder.h server: misc header cleanups 2015-12-09 22:17:51 +00:00
image-cache.c server: rename files 2015-12-03 23:54:32 +00:00
image-cache.h server: rename files 2015-12-03 23:54:32 +00:00
inputs-channel.c channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
inputs-channel.h server: rename files 2015-12-03 23:54:32 +00:00
jpeg-encoder.c server: rename files 2015-12-03 23:54:32 +00:00
jpeg-encoder.h server: rename files 2015-12-03 23:54:32 +00:00
lz4-encoder.c server: rename files 2015-12-03 23:54:32 +00:00
lz4-encoder.h server: rename files 2015-12-03 23:54:32 +00:00
main-channel.c channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
main-channel.h server: rename files 2015-12-03 23:54:32 +00:00
main-dispatcher.c channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
main-dispatcher.h channel: add a new internal SpiceCoreInterface 2016-01-11 16:29:53 +00:00
Makefile.am build: Don't list some installed headers twice 2015-12-14 12:27:09 +00:00
memslot.c server: misc header cleanups 2015-12-09 22:17:51 +00:00
memslot.h server: rename files 2015-12-03 23:54:32 +00:00
migration-protocol.h server: rename files 2015-12-03 23:54:32 +00:00
mjpeg-encoder.c server: Add time constants to go with spice_get_monotonic_time_ms() 2015-12-14 11:24:47 +00:00
mjpeg-encoder.h server: rename files 2015-12-03 23:54:32 +00:00
pixmap-cache.c syntax-check: Add missing #include <config.h> 2015-10-19 14:25:36 +02:00
pixmap-cache.h server: rename files 2015-12-03 23:54:32 +00:00
red-channel.c channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
red-channel.h channel: add a new internal SpiceCoreInterface 2016-01-11 16:29:53 +00:00
red-common.h channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
red-dispatcher.c red-dispatcher: group cases 2015-12-10 19:12:10 +00:00
red-dispatcher.h server: misc header cleanups 2015-12-09 22:17:51 +00:00
red-parse-qxl.c check properly if red_get_data_chunks fails or not 2016-01-08 18:16:42 +00:00
red-parse-qxl.h server: rename files 2015-12-03 23:54:32 +00:00
red-record-qxl.c server: Use '%zu' to print size_t variables 2015-12-15 17:50:05 +00:00
red-record-qxl.h server: rename files 2015-12-03 23:54:32 +00:00
red-replay-qxl.c server: Use '%zu' to print size_t variables 2015-12-15 17:50:05 +00:00
red-replay-qxl.h server: rename files 2015-12-03 23:54:32 +00:00
red-worker.c channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
red-worker.h stats: use CLOCK_THREAD_CPUTIME_ID for cpu statistics 2016-01-11 16:29:08 +00:00
reds-private.h server: Add time constants to go with spice_get_monotonic_time_ms() 2015-12-14 11:24:47 +00:00
reds-stream.c channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
reds-stream.h reds-stream: add reds_stream_is_plain_unix() 2015-12-21 13:20:53 +00:00
reds.c channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
reds.h channel: add a new internal SpiceCoreInterface 2016-01-11 16:29:53 +00:00
smartcard.c channel: rename red_channel_(client_)waits_* functions 2015-12-10 17:22:59 +00:00
smartcard.h Remove spice-experimental 2015-01-15 18:34:26 +01:00
sound.c channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
sound.h server: rename files 2015-12-03 23:54:32 +00:00
spice_timer_queue.c channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
spice_timer_queue.h channel: add interface parameters to SpiceCoreInterfaceInternal 2016-01-11 16:40:17 +00:00
spice-audio.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-bitmap-utils.c server: merge spice-bitmap-utils and spice_bitmap_utils 2015-12-09 22:16:10 +00:00
spice-bitmap-utils.h server: misc header cleanups 2015-12-09 22:17:51 +00:00
spice-bitmap-utils.tmpl.c server: rename _tmpl files 2015-11-26 13:33:36 +00:00
spice-char.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-core.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-experimental.h Add missing license headers 2015-10-19 14:25:36 +02:00
spice-input.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-migration.h Move spice_server_get_num_clients() declaration 2014-11-27 15:03:38 +01:00
spice-qxl.h worker: avoid to use constant directly for capabilities size 2015-10-29 17:46:27 +00:00
spice-server.h Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
spice-server.syms server/red_{record, replay}.[ch]: introduce 2015-08-21 09:38:44 +01:00
spice-version.h.in build-sys: generate spice-version.h 2014-11-27 14:27:33 +01:00
spice.h Split spice.h 2014-11-27 14:27:18 +01:00
spicevmc.c channel: rename red_channel_(client_)waits_* functions 2015-12-10 17:22:59 +00:00
stat.h stat: use a better design for statistic functions 2015-12-09 17:02:48 +00:00
stream.c server: Use PRI macros in printf for 32/64 bit compatibility 2015-12-15 17:47:50 +00:00
stream.h server: Add time constants to go with spice_get_monotonic_time_ms() 2015-12-14 11:24:47 +00:00
sw-canvas.c server: misc header cleanups 2015-12-09 22:17:51 +00:00
sw-canvas.h server: rename files 2015-12-03 23:54:32 +00:00
tree.c pass proper type to SPICE_CONTAINEROF 2015-12-04 13:33:54 +00:00
tree.h Move some tree item functions to tree.[ch] 2015-11-17 17:22:05 +00:00
utils.c worker: move dcc_add_surface_area_image 2015-11-23 13:50:44 +00:00
utils.h server: Add time constants to go with spice_get_monotonic_time_ms() 2015-12-14 11:24:47 +00:00
zlib-encoder.c server: rename files 2015-12-03 23:54:32 +00:00
zlib-encoder.h server: rename files 2015-12-03 23:54:32 +00:00