summaryrefslogtreecommitdiffstats
path: root/server/red_dispatcher.h
Commit message (Collapse)AuthorAgeFilesLines
* server/red_dispatcher: close pa hole in RedWorkerMessageDisplayConnect for ↵Alon Levy2013-05-171-2/+2
| | | | valgrind
* server: Add public spice_qxl_driver_unload methodHans de Goede2013-04-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | With a SPICE_DISPLAY_CAP_MONITORS_CONFIG capable client, the client needs to know what part of the primary to use for each monitor. If the guest driver does not support this, the server sends messages to the client for a single monitor spanning the entire primary. As soon as the guest calls spice_qxl_monitors_config_async once, we set the red_worker driver_has_monitors_config flag and stop doing this. This is a problem when the driver gets unloaded, for example after a reboot or when switching to a text vc with usermode mode-setting under Linux. To reproduce this start a multi-mon capable Linux guest which uses usermode mode-setting and then once X has started switch to a text vc. Note how the client window does not only not resize, if you try to resize it manually you always keep blackborders since the aspect is wrong. This patch is the spice-server side of fixing this, it adds a new spice_qxl_driver_unload method which clears the driver_has_monitors_config flag. The other patch needed to fix this is in qemu, and will calls this new method from qxl_enter_vga_mode. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* server/red_dispatcher: client_monitors_config supportAlon Levy2012-09-131-0/+4
| | | | | | | | | Adds two functions: - red_dispatcher_use_client_monitors_config: check that QXLInterface supports client_monitors_config and that it's functional. - red_dispatcher_client_monitors_config: send the client monitors configuration to the guest.
* spice_server_vm_start/stop: notify red_dispatcher on vm start/stopYonit Halperin2012-08-271-0/+2
| | | | | | | Till now, red_worker was notfied about vm status changes via QXLWorker->start/stop (or spice_qxl_start/stop). Newer qemu, that supports calling spice_server_vm_start/stop, will call only these routines, and won't call QXLWorker->start/stop.
* server: add monitors_config supportAlon Levy2012-07-221-0/+5
| | | | | | | | | | | | | | | | a SpiceMsgDisplayMonitorsConfig is sent on two occasions: * as a result of a spice_qxl_monitors_config_async * whenever a client connects and there is a previously set monitors config Sending the new message is protected by a new cap, SPICE_DISPLAY_CAP_MONITORS_CONFIG More elaborately: spice_qxl_monitors_config_async receives a QXLPHYSICAL address of a QXLMonitorsConfig struct and reads it, caching it in the RedWorker, and sending it to all clients. Whenever a new client connects it receives a SpiceMsgDisplayMonitorsConfig message as well.
* server/red_worker: pass remote caps to display/cursor red_channel_client'sYonit Halperin2012-01-121-0/+8
|
* server/red_worker: reuse dispatcherAlon Levy2011-11-081-0/+149
| | | | | | | | | | | | | | | | | | | | | | This patch reuses Dispatcher in RedDispatcher. It adds two helpers to red_worker to keep RedWorker opaque to the outside. The dispatcher is abused in three places that use the underlying socket directly: once sending a READY after red_init completes once for each channel creation, replying with the RedChannel instance for cursor and display. FDO Bugzilla: 42463 rfc->v1: * move callbacks to red_worker.c including registration (Yonit) * rename dispatcher to red_dispatcher in red_worker.c and red_dispatcher.c * add accessor red_dispatcher_get_dispatcher * s/dispatcher_handle_recv/dispatcher_handle_recv_read/ and change sig to just Dispatcher *dispatcher (was the SpiceCoreInterface one) * remove SpiceCoreInterface parameter from dispatcher_init (Yonit) * main_dispatcher needed it for channel_event so it has it in struct MainDispatcher * add dispatcher_get_recv_fd for red_worker
* server/red_dispatcher: support concurrent asyncsAlon Levy2011-11-071-1/+2
| | | | | | | | | | | | | | | This is part of the dispatcher update, extracting the dispatcher routine from red_dispatcher and main_dispatcher into dispatcher. Supporting multiple async operations will make it natural to support async monitor commands and async guest io requests that could overlap in time. Use a Ring for AsyncCommands. Free Desktop Bugzilla: 42463 Related FD: 41622
* server: registering RedChannel in reds, instead of ChannelYonit Halperin2011-08-231-5/+0
| | | | | | | | | | | | | | | | | | | | | | | Merging the functionality of reds::channel, into RedChannel. In addition, cleanup and fix disconnection code: before this patch, red_dispatcher_disconnect_display_client could have been called from the red_worker thread (and it must be called only from the io thread). RedChannel holds only connected channel clients. RedClient holds all the channel clients that were created till it is destroyed (and then it destroys them as well). Note: snd_channel still doesn't use red_channel, however it creates dummy channel and channel clients, in order to register itself in reds. server/red_channel.c: a channel is connected if it holds at least one channel client Previously I changed RedChannel to hold only connected channel clients and RedClient, to hold all the channel clients as long as it is not destroyed. usbredir: multichannel has not been tested, it just compiles.
* server: Add RedClientAlon Levy2011-08-231-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That means RedClient tracks a ring of channels. Right now there will be only a single client because of the disconnection mechanism - whenever a new client comes we disconnect all existing clients. But this patch adds already a ring of clients to reds.c (stored in RedServer). There is a known problem handling many connections and disconnections at the same time, trigerrable easily by the following script: export NEW_DISPLAY=:3.0 Xephyr $NEW_DISPLAY -noreset & for ((i = 0 ; i < 5; ++i)); do for ((j = 0 ; j < 10; ++j)); do DISPLAY=$NEW_DISPLAY c_win7x86_qxl_tests & done sleep 2; done I fixed a few of the problems resulting from this in the same patch. This required already introducing a few other changes: * make sure all removal of channels happens in the main thread, for that two additional dispatcher calls are added to remove a specific channel client (RED_WORKER_MESSAGE_CURSOR_DISCONNECT_CLIENT and RED_WORKER_MESSAGE_DISPLAY_DISCONNECT_CLIENT). * change some asserts in input channel. * make main channel disconnect not recursive * introduce disconnect call back to red_channel_create_parser The remaining abort is from a double free in the main channel, still can't find it (doesn't happen when running under valgrind - probably due to the slowness resulting from that), but is easy to see when running under gdb.
* server: add async io supportAlon Levy2011-07-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The new _ASYNC io's in qxl_dev listed at the end get six new api functions, and an additional callback function "async_complete". When the async version of a specific io is used, completion is notified by calling async_complete, and no READY message is written or expected by the dispatcher. update_area has been changed to push QXLRects to the worker thread, where the conversion to SpiceRect takes place. A cookie has been added to each async call to QXLWorker, and is passed back via async_complete. Added api: QXLWorker: update_area_async add_memslot_async destroy_surfaces_async destroy_primary_surface_async create_primary_surface_async destroy_surface_wait_async QXLInterface: async_complete
* use foo(void) instead of foo() in prototypesChristophe Fergeau2011-05-021-5/+5
| | | | | In C, the latter isn't a prototype for a function with no arg, but declares a function with an undefined number of args.
* QXL: redesign.Gerd Hoffmann2010-05-191-1/+1
|
* VDInterface: redesign.Gerd Hoffmann2010-05-191-1/+1
| | | | | | | | | | | | VDInterface has been renamed to SpiceBaseInterface. Dropped base_version element, shlib versioning should be used instead. Dropped id element, it is passed to spice_server_add_interface() instead. Now SpiceBaseInterface has static information only, multiple interface instances can share it. Added SpiceBaseInstance struct for maintaining per-instance state information. Adapted spice_server_{add,remove}_interface() functions to the new world.
* Relicense everything from GPL to LGPL 2.1+Alexander Larsson2010-04-131-9/+9
|
* fresh startYaniv Kamay2009-10-141-0/+33