summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* server/red_worker: remove more direct access to RedChannelClient.rccAlon Levy2011-08-231-36/+51
|
* server/red_worker.c: make dictionary and cache different per clientYonit Halperin2011-08-231-23/+31
| | | | | | | | | There is no inter-client shared dictionary and cache yet. At this point the display channel can be used by multiple clients. You can still crash on lack of Drawables or CursorItems due to the slower clients pipe growing uncontrollably.
* server/red_worker: multiple client support - base splitAlon Levy2011-08-235-808/+1014
| | | | | | | | | | | | | | | | | | This patch compiles but breaks spice. Split both display and cursor channels to a client part and channel part. Introduce DisplayChannelClient, CursorChannelClient, CommonChannelClient. don't disconnect channel on client disconnect. Move all caches to the ChannelClient's. Remove reference counting of the channel. No new functionality introduced. NOTE: Introduces a crash in disconnections, a regression, resulting from incorrect thread access, that is fixed in the patch titled: "server: registering RedChannel in reds, instead of Channel"
* server/red_worker: cleanupAlon Levy2011-08-231-30/+49
|
* server/smartcard: support multiple clientsAlon Levy2011-08-231-34/+46
| | | | | | | | | each client supplying a smartcard channel gets it's own smartcard. If there are not enough smartcards provided by the server (read: qemu) then it will be as though there are none. currently disabled - later patches that enable smartcard don't make this channel available to any but the first client.
* server/red_tunnel_worker: trivial multi client supportAlon Levy2011-08-233-128/+134
| | | | | | | | | | | | s/TunnelChannel/TunnelChannelClient/ That's about it. this is probably the wrong way to do it. Not tested at all. What do we want, a separate interface per client? same interface for all clients? probably the later. This doesn't do that. Not tested, so probably doesn't even work. changes red_channel_pipe_item_is_linked to red_channel_client_pipe_item_is_linked, since tunnel channel is the only user, must be done in patch to not break compilation.
* server/inputs_channel: support multiple clientsAlon Levy2011-08-231-28/+29
| | | | | from server events are broadcast - leds change. The rest is client to server, so it is just passed on.
* server/main_channel: support multiple clientsAlon Levy2011-08-234-164/+209
| | | | | | | | | | | | | | | | The main channel deals with connecting new clients, announcing mouse mode changes, and the agent channel. The implementation is currently done without any changes to the protocol, so everything has to be either broadcast or to a specific client. channels list - specific client mouse mode - broadcast agent - broadcast notify - broadcast (should have two modes, and use the appropriate) Notable TODOs: * migration testing * agent tokens are wrongly sent (or did I fix that? check)
* server/red_channel: introduce pipes functionsAlon Levy2011-08-232-8/+69
| | | | | | | | | | Introduce functions to add (via producer method) the same item to multiple pipes, all for the same channel. Note: Right now there is only a single channel, but the next patches will do the per-channel breakdown to channel and channel_client before actually introducing a ring in RedChannel, this makes it easier to make smaller changes - the channel->rcc link will exist until removed in the ring introducing patch.
* server/red_channel: ignore error if already shutdownAlon Levy2011-08-231-0/+3
| | | | | | on red_channel_peer_on_incoming_error, if we are already shutdown, do not call the channel's error handler. Since the channel has been shutdown, we assume this is a second or later error, and handling has already occured.
* server/main_channel: move connection_id from redsAlon Levy2011-08-233-20/+40
| | | | | | | | | | Expose additional api to find a client given a connection_id. The connection_id is first set when the first channel connects, which is the main channel. It could also be kept in the RedClient instead, not sure. TODO: multiple todo's added for multiclient handling. I don't remember why I wrote them exactly, and besides if I did any migration tests. So: TODO.
* server/main_channel: move ping here from reds.Alon Levy2011-08-233-51/+56
| | | | | | | | | | | | | cleanup only. Note that the ping function is half used since the opt parameter stopped being called with anything but NULL, should be returned at some point, specifically when we drop the 250kbyte ping on start and do a continuous check for latency and bandwidth. See: 81945d897 - server: add new vd interface QTerm2Interface, Yaniv Kamay introducing the usage of ping with a non NULL opt 3f7ea8e7a - zap qterm interfaces, Gerd Hoffman removing it
* server/main_channel: move latency and bitrate to channel clientAlon Levy2011-08-237-40/+96
| | | | | | | | | | | | They were globals before. This introduces api for other channels to query the low bandwidth status. The queries themselves are still done from the wrong context (channel and not channel client) but that's because the decoupling of channel and channel client will be done in the following patches. Note that snd_worker.c got two copied function declarations that belong to main_channel.h but can't be easily dragged into snd_worker.c since it still uses it's own RedChannel struct.
* server/reds: add concept of secondary channelsAlon Levy2011-08-231-4/+26
| | | | | | | | | | | | | | | | | | Secondary channels are those that don't support multiple clients. The support added in this patch just doesn't let the second or more connected client receive the unsupported channels in the channels list sent by the server to the client. This doesn't handle the situation where: client A connects (gets all channels) client B connects (gets supported multiple client channels) client A disconnects (Suboptimal 1: B doesn't get new channels at this point) client C connects (Suboptimal 2: C doesn't get the full list of channels, but the partial one) Specifically the channels that only support a single client are: sound (both playback and record channels) smartcard tunnel
* server: Add RedClientAlon Levy2011-08-2315-116/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/main_channel+reds: make main_channel_init return MainChannelClientAlon Levy2011-08-233-22/+22
| | | | This makes it easier to introduce RedClient in the next patch.
* server/red_worker: release PIPE_ITEM_TYPE_VERB in display channelAlon Levy2011-08-231-0/+3
| | | | We send a SPICE_MSG_DISPLAY_MARK verb.
* server/red_client: clear pipe on disconnectAlon Levy2011-08-231-1/+1
|
* server/red_channel: workaround for fast client disconnect bug (TODO - real fix)Alon Levy2011-08-231-0/+5
|
* server/main_channel: use MainChannel in sigAlon Levy2011-08-235-99/+93
| | | | | | | use MainChannel* instead of Channel* for a many functions in main_channel.h (affects main_channel.c and reds.c). some one liner fixes are hidden in here too.
* server: move pipe from RedChannel to RedChannelClientAlon Levy2011-08-2310-241/+314
| | | | | | | | | | | | | | | | | | | | | | | Another cleanup patch, no change to behavior (still one client, and it disconnects previous client if any). The implementation for multiple client is straightforward: the pipe remains per (channel,client) pair, so it needs to move from the RedChannel that to RedChannelClient. Implementation using a single pipe with multiple consumers (to reflect different latencies) doesn't fit well with pipe rewriting that is used by the display channel. Additionally this approach is much simpler to verify. Lastly it doesn't add considerable overhead (but see the display channel changes in a later patch for a real place to rethink). This patch is just technical, changing signatures to reflect the first argument (oop style) so red_channel becomes red_channel_client. Some places may seem odd but they should be fixed with later comits where the channels grow to support multiple clients. Sound (playback/record) channels are the only ones not touched - this is consistent with previous patches, since they have been left out of the RedChannel refactoring. That is left as future work. (note that they don't use a pipe, which was the reason for not refactoring).
* server/red_worker: introduce {display,cursor}_is_connectedAlon Levy2011-08-231-18/+32
| | | | Instead of checking for worker->{display,cursor}_channel directly.
* server/red_channel (all): introduce RedChannelClientAlon Levy2011-08-239-861/+1140
| | | | | | | | | | | | | | | | | | | | | This commit adds a RedChannelClient that now owns the stream connection, but still doesn't own the pipe. There is only a single RCC per RC right now (and RC still means RedChannel, RedClient will be introduced later). All internal api changes are in server/red_channel.h, hence the need to update all channels. red_worker.c is affected the most because it makes use of direct access to some of RedChannel still. API changes: 1. red_channel_client_create added. rec_channel_create -> (red_channel_create, red_channel_client_create) 2. two way connection: rcc->channel, channel->rcc (later channel will hold a list, and there will be a RedClient to hold the list of channels per client) 3. seperation of channel disconnect and channel_client_disconnect TODO: usbredir added untested.
* server/red_worker: drop red_pipe_add_tail, use red_channel_pipe_add_tailAlon Levy2011-08-232-9/+2
| | | | | | The only difference between them being that the later also does a push. I don't believe that to be a problem, but if it does I can always introduce a push'less version.
* server/red_channel: renames to use _proc postfix consistentlyAlon Levy2011-08-233-21/+21
| | | | | | | | | rename types - we use _proc suffix mostly to indicate function pointer types, use it for some function pointers that were missing it. s/channel_handle_migrate_flush_mark/channel_handle_migrate_flush_mark_proc/ s/channel_handle_migrate_data_get_serial/channel_handle_migrate_data_get_serial_proc/ s/channel_handle_migrate_data/channel_handle_migrate_data_proc/
* spice.proto: add comment for origin of STYLED and START_WITH_GAPAlon Levy2011-08-231-0/+5
|
* server/red_worker: explicitly include unistd and errnoAlon Levy2011-08-231-0/+2
|
* common: introduce red_printf_debugAlon Levy2011-08-231-0/+10
|
* server/tests/test_playback: correctly use spice_server_playback_get_bufferAlon Levy2011-08-231-14/+27
| | | | | | | and spice_server_playback_put_samples. The former retrieves a buffer from a free list with spice_server_playback_get_buffer, and should be used once via spice_server_playback_put_samples. The tester previously reused the same buffer a number of times.
* server/tests/basic_event_loop: multiple fixesAlon Levy2011-08-233-128/+37
| | | | | | reuse common/ring.h ignore SIGPIPE fix handling of removed watches
* tests/migrate.py: add --vdagentAlon Levy2011-08-231-5/+10
| | | | | | | | | | | | | | | | Adds the required options to provide a vdagent to the guest in both source and target qemu instances. This will be the last update of the in spice git tests directory, I've moved those tests to the repository spice-tests. The longer term goal remains autotest integration, but since this test (and some minor others for qemu) need a home it is: http://cgit.freedesktop.org/~alon/spice-tests/ (I'm reluctant to put it under spice/ because of my wish to go to autotest, but still, there they are. Nothing as permanent as the temporary). Independent (of external modules, i.e. qemu) tests (server/tests) should remain in tree.
* server/red_worker.c: fix - locking the wrong mutex when releasing glz dictYonit Halperin2011-08-231-3/+3
|
* server/tests/test_display_base: fix compileAlon Levy2011-08-231-2/+4
|
* common/ring: RING_FOREACH_SAFE: use shorter version from qemuAlon Levy2011-08-231-5/+3
|
* server/reds.h: explicitly include config.hAlon Levy2011-08-231-0/+2
|
* server/tests/migrate.py: make executableAlon Levy2011-08-231-0/+1
|
* use Xkb to get keyboard modifier maskChristophe Fergeau2011-08-171-23/+2
| | | | | | | | | | | | | | To be able to enable/disable keyboard leds on X11, we need to query the X server for which mask correspond to which led (NumLock, CapsLock). So far this was done using XKeysymToKeycode and iterating over X modifier mapping. Xkb provides XkbKeysymToModifiers for this purpose, and since we're using Xkb anyway, it makes more sense to use it. At some point, on my Fedora 15 box, XKeysymToKeycode was returning NoSymbol for CapsLock and NumLock leading to spicec not being able to change the keyboard leds when qemu tells it to. However, I couldn't reproduce this when I tried again :-/
* fix harmless typo in InputsChannel::handle_modifiersChristophe Fergeau2011-08-171-1/+1
| | | | | | | | | | | | | | InputsChannel::handle_modifiers converts _modifiers which is a bitflag of SPICE_KEYBOARD_MODIFIER_FLAGS_* to a Platform::*_MODIFIER bitflag, which is what Platform::set_keyboard_lock_modifiers expects. However, it's called with _modifiers, and the bitflag that this function computes is never used. Pass the computed bitflag to ::set_keyboard_lock_modifiers since _modifiers format is meaningless for ::set_keyboard_lock_modifiers. This bug was harmless because the two different set of modifier flags actually use the same values, so _modifiers and modifiers could be used interchangeably. However it's more future-proof to use the right format here.
* fix 2 X11 related leaksChristophe Fergeau2011-08-152-4/+8
|
* channel: fix EVP_PKEY leakChristophe Fergeau2011-08-151-3/+7
|
* always set VDAgentDisplayConfig::depthChristophe Fergeau2011-08-151-0/+1
| | | | | | Even if VDAgentDisplayConfig::depth will be unused if the VD_AGENT_DISPLAY_CONFIG_FLAG_SET_COLOR_DEPTH isn't set, it's better to initialize it anyway to avoid warnings from valgrind.
* server: Add a usbredir channelHans de Goede2011-08-105-1/+295
|
* client/red_client: fix broken switch host migration (RHBZ 727969)Alon Levy2011-08-031-0/+1
| | | | | | 3f8d7e59dbd94b1837503f37b5065698df3ffbc7 introduced a regression, after sending one attach_channels message we never send another one. Fix by resetting on disconnect.
* mjpeg: add missing SPICE_BITMAP_FMT_RGBAChristophe Fergeau2011-08-021-0/+1
| | | | | I forgot to handle SPICE_BITMAP_FMT_RGBA when mapping from spice image formats to libjpeg-turbo colorspaces.
* Fix typo: treshold -> thresholdLiang Guo2011-08-021-1/+1
|
* Fix typo: seperator -> separatorLiang Guo2011-08-023-24/+24
|
* mjpeg: fix libjpeg assertionChristophe Fergeau2011-08-011-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the changes to add libjpeg-turbo support to spice-server mjpeg compression code, it's relatively easy to hit an assertion from libjpeg in spice-server about "too few scanlines transferred" when the mjpeg streaming code triggers. This assertion brings down qemu, which is bad :) This is because when we first initialize the mjpeg encoder, we do: stream_width = SPICE_ALIGN(src_rect->right - src_rect->left, 2); stream_height = SPICE_ALIGN(src_rect->bottom - src_rect->top, 2); stream->mjpeg_encoder = mjpeg_encoder_new(stream_width, stream_height); and then when we iterate over the image scanlines to feed them to libjpeg, we do: const int image_height = src->bottom - src->top; const int image_width = src->right - src->left; for (i = 0; i < image_height; i++) { mjpeg_encoder_encode_scanline(...); } mjpeg_encoder_end_frame(...); When stream_height is odd, the mjpeg_encoder will be created with an height that is 1 more than the number of lines we encode. Then libjpeg asserts when we tell it we're done with the compression while it's still waiting for one more scanline. Looking through git history, this rounding seems to be an artifact from when we were using ffmpeg for the mjpeg encoding. Since spicec and spicy (the latter needs a few fixes) can handle streams with odd height/width, the best way to solve this issue is to stop rounding up the height and width of the streams we create. This even saves some bandwidth :)
* server/red_dispatcher: fix wrong resolution set for tabletAlon Levy2011-07-311-4/+4
| | | | | | | | | | | when changing resolutions due to the new async code paths the surface creation command was kept by reference, and later, when the red_worker signaled completion by calling async_complete the mouse mode was updated using the reference. This caused the wrong values to be read resulting in wrong resolutions set and a non working mouse pointer. Fix this by keeping a copy of the surface creation command instead of a reference. No bz. Found in testing.
* client: fix 30s timeout regressionChristophe Fergeau2011-07-311-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Changelog from Arnon Gilboa, patch from me: Commit eb6f55409412 caused the following regression: When client runs without the auto-conf or disable-effects options (either from CLI or controller), which is the case when using Spice from Admin Portal, the client will unecessarily wait for 30sec before connecting to a Windows guest with an agent running (this won't happen with linux guests or without an agent running). The mentioned patch assumed that on_agent_reply() of VD_AGENT_DISPLAY_CONFIG will call send_main_attach_channels() and connect. However, when auto-conf or disable-effects are not used, on_agent_reply() will ignore the reply and not call send_main_attach_channels(). Therefore, send_main_attach_channels() will only be called on agent timeout. The solution is to activate agent timer only if auto-conf or disable-effects. Otherwise, simply call send_main_attach_channels(). Fixes rhbz #726441
* common/backtrace.h: disable for WIN32Alon Levy2011-07-311-0/+4
| | | | | This also catches mingw32 which is probably fine, but at least it fixes the build on visual studio.