summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* server: handling semi-seamless migration in the target sideYonit Halperin2011-09-251-20/+116
| | | | | | | | | | (1) not sending anything to the client till we recieve SPICE_MSGC_MIGRATE_END (2) start a new migration (handle client_migrate_info) only after SPICE_MSGC_MIGRATE_END from the previous migration has been received (3) use the correct ticket Note: we assume the same channles are linked before and ater migration. i.e., SPICE_MSGC_MAIN_ATTACH_CHANNELS is not sent from the client.
* server: move the linking of channels to a separate routineYonit Halperin2011-09-251-26/+41
|
* server: move SPICE_MSG_MAIN_INIT sending code to a separate routineYonit Halperin2011-09-251-23/+33
|
* server: send SPICE_MSG_MAIN_MIGRATE_END on spice_server_migrate_endYonit Halperin2011-09-251-18/+67
|
* spice.proto: add SPICE_MSG_MAIN_MIGRATE_END & SPICE_MSGC_MAIN_MIGRATE_ENDYonit Halperin2011-09-251-0/+4
|
* server,proto: tell the client to connect to the migration target before ↵Yonit Halperin2011-09-253-40/+115
| | | | | | | | migraton starts (1) send SPICE_MSG_MAIN_MIGRATE_BEGIN upon spice_server_migrate_connect (2) wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR), or a timeout, in order to complete client_migrate_info monitor command
* configure: spice-protocol >= 0.8.2 (semi-seamless migration protocol)Yonit Halperin2011-09-251-1/+1
|
* server: handle migration interface additionYonit Halperin2011-09-252-0/+33
|
* server/spice.h: semi-seamless migration interface, RHBZ #738266Yonit Halperin2011-09-253-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | semi-seamless migration details: migration source side --------------------- (1) spice_server_migrate_connect (*): tell client to link to the target side - send SPICE_MSG_MAIN_MIGRATE_BEGIN. This should be called upon client_migrate_info cmd. client_migrate_info is asynchronous. (2) Complete spice_server_migrate_connect only when the client has been connected to the target - wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) or a timeout. (3) spice_server_migrate_end: tell client migration it can switch to the target - send SPICE_MSG_MAIN_MIGRATE_END. (4) client cleans up all data related to the connection to the source and switches to the target. It sends SPICE_MSGC_MAIN_MIGRATE_END. migration target side --------------------- (1) the server identifies itself as a migraiton target since the client is linked with (connection_id != 0) (2) server doesn't start the channels' logic (channel->link) till it receives SPICE_MSGC_MAIN_MIGRATE_END from the client. * After migration starts, the target qemu is blocked and cannot accept new spice client connections. Thus, we trigger the connection to the target upon client_migrate_info command.
* client: don't crash when booting a Xinerama setupChristophe Fergeau2011-09-201-4/+6
| | | | | | | | | | | | | | | | | | In a Xinerama setup, when X starts up and creates one of the secondary screens, first a non-primary surface is created on the secondary screen, and then the primary surface for this screen is created. This causes a crash when the guest uses Xinerama and the client is attached to the VM before X starts (ie while the guest is booting). This happens because DisplayChannel::create_canvas (which is called when creating a non-primary surface) assumes a screen has already been set for the DisplayChannel while this only happens upon primary surface creation. However, it uses the screen for non important stuff, so we can test if screen() is non NULL before using it. This is what is done in other parts of this file. Fixes rhbz #732423
* fix infinite loop in resolution changeMarc-André Lureau2011-09-201-1/+7
| | | | | | | | | | | | After hours of investigation, I am a bit clueless.. It seems XRR is sending us spurious ScreenChangeNotify in a loop. So we keep calling init_monitors(), which creates new platform_win etc.. Although none of the clients seems to be resetting the screen (checked all XRRSet..). The fact that we create many platform_win looks like a bug to me, and indeed, it seems to help if we reuse the same platform_win over the various init_monitors() calls. Fixes rhbz #692833
* fix 2 X11 related leaksChristophe Fergeau2011-09-202-4/+8
|
* channel: fix EVP_PKEY leakChristophe Fergeau2011-09-201-3/+7
|
* always set VDAgentDisplayConfig::depthChristophe Fergeau2011-09-201-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.
* fix integer marshalling helpers on big endianChristophe Fergeau2011-09-201-6/+6
| | | | | | They were trying to convert the destination pointer to an integer before trying to dereference it. The initial conversion was meant to be a cast to a pointer of the right size, not to an integer.
* fix typo in big endian code pathChristophe Fergeau2011-09-201-2/+2
| | | | uint63_t should be uint64_t
* server/smartcard: fix smartcard_channel_send_errorAlon Levy2011-09-201-23/+7
| | | | | | | | It was sending the wrong data, the memory right after the VCSMsgHeader which was actually not where the data was. Fixed by having the header and data (VSCError, 4 bytes of the error code) embedded in the ErrorItem pipe item.
* client: setting monitors resolution before resizing screens, RHBZ #728252Yonit Halperin2011-08-252-12/+34
| | | | fix for "client: fix endless recursion in rearrange_monitors, RHBZ #692976"
* 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.
* 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
* Drop unnecessary X11 and alsa requires from spice-server.pcHans de Goede2011-07-271-3/+0
|
* server: not reading command rings before RED_WORKER_MESSAGE_START, RHBZ #718713Yonit Halperin2011-07-241-1/+11
| | | | | | | On migration, destroy_surfaces is called from qxl (qxl_hard_reset), before the device was loaded (on destination). handle_dev_destroy_surfaces led to red_process_commands, which read the qxl command ring (which appeared to be not empty), and then when processing the command it accessed unmapped memory.
* Release 0.8.20.8.2Alon Levy2011-07-223-2/+13
|
* distcheck: add --enable-smartcard --with-saslAlon Levy2011-07-221-1/+1
|
* fix make distcheckChristophe Fergeau2011-07-228-12/+13
|
* client: don't die if initial agent timeout triggersChristophe Fergeau2011-07-222-2/+10
| | | | | | | | | | When the client connects to a spice VM, if an agent is detected, there will be a few messages exchanged to exchange capabilities, display resolutions, ... This exchange has a timeout in case something goes wrong. However, when it fires, the client dies. This commit changes this and lets the client connects to the guest when the timeout happens. rhbz #673973
* client: only send one SPICE_MSGC_MAIN_ATTACH_CHANNELS messagesChristophe Fergeau2011-07-212-8/+16
| | | | | | | | | | | | | | 492f7a9b fixed unwanted timeouts during initial client startup, but it also caused a bad regression when connecting to RHEL6+agent guests: the SPICE_MSGS_MAIN_ATTACH_CHANNELS message was sent multiple times, once in RedClient::handle_init, then once again in RedClient::on_agent_announce_capabilities (which can even be triggered multiple times). Sending this message multiple times is a big NO and causes the server to close the client connection, and the client to die. Add a _msg_attach_message_sent boolean to make sure we only send this message once. rhbz #712938
* client: fix endless recursion in rearrange_monitors, RHBZ #692976Yonit Halperin2011-07-214-50/+54
| | | | | | | I changed RedScreen::resize not to call rearrange_monitors. Instead, the monitor should be configured correctly from Application, before calling resize. In addition, I made some cleanups to allow reusing rearrange_monitors code.
* server/red_worker: send surface images to client on-demand after S3/4 wakeupYonit Halperin2011-07-211-9/+22
| | | | | | When surfaces are being reloaded to the worker, we will send them to the client only if and when it needs them. (cherry picked from commit 51628f512456cd26c8c6b417be6b34f3889b33d2)
* server/spice.h: bump QXL_MINOR because of QXLWorker and QXLInterface changesAlon Levy2011-07-211-1/+1
| | | | (cherry picked from commit 3be08d68c01618c81e0dff6caab125a53b4c047e)
* server: add QXLWorker.flush_surfaces_async for S3/S4 supportAlon Levy2011-07-215-4/+46
| | | | | | | | | | | | This does the following, all to remove any referenced memory on the pci bars: flush_all_qxl_commands(worker); flush_all_surfaces(worker); red_wait_outgoing_item((RedChannel *)worker->display_channel); red_wait_outgoing_item((RedChannel *)worker->cursor_channel); The added api is specifically async, i.e. it calls async_complete when done. (cherry picked from commit 2a4d97fb780cf3ce2d9060751d0bec2fdc9800a9)
* server: add QXLInterface::update_area_complete callbackAlon Levy2011-07-212-16/+47
| | | | | | when update_area_async is called update_area_complete will be called with the surfaces dirty rectangle list. (cherry picked from commit b26f0532c170068e91e4946592eab2fd9d6cbae5)
* server/red_worker: handle_dev_input: reuse write_ready introduced for asyncAlon Levy2011-07-211-8/+4
| | | | (cherry picked from commit f300de20d9fd7731881ab99c87226fa44a80695b)
* server: add async io supportAlon Levy2011-07-218-91/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit 096f49afbf4e83ccee80f58479b3ff05bd355660)
* server: replace redundant code with red_cursor_resetYonit Halperin2011-07-211-47/+24
| | | | | | | In addition (1) make handle_dev_destroy_surfaces call red_release_cursor (2) call red_wait_outgoing_item(cursor_channel) only after adding msgs to pipe [3d3066b175ee2dec8e73c8c56f418a6ae98b1c26 cherry-pick with modifications]
* use foo(void) instead of foo() in prototypesChristophe Fergeau2011-07-2117-31/+31
| | | | | | | | In C, the latter isn't a prototype for a function with no arg, but declares a function with an undefined number of args. [picked from master with changes since no main_channel, spice_common, and a bunch of functions aren't there yet]
* bump required spice-protocol to 0.8.1 for qxl_dev async and s3 updatesAlon Levy2011-07-211-1/+1
|
* server: api: add spice_qxl_* calls based on QXLWorker contentsAlon Levy2011-07-213-31/+226
| | | | | | | | | | | For each callback in QXLWorker, for example QXLWorker::update_area, add a direct call named spice_qxl_update_area. This will (a) remove the pointless indirection and (b) make shared library versioning alot easier as we'll get new linker symbols which we can tag with the version they appeared in the shared library. [cherry-picked from master]
* s/__visible__/SPICE_GNUC_VISIBLEChristophe Fergeau2011-07-214-55/+55
| | | | | | | The C specification reserves use of identifiers starting with __ to the compiler so we shouldn't use one such symbol. [cherry-pick from master]
* server: spice-server.syms: move sasl symbols to 0.8.2Alon Levy2011-07-211-0/+6
| | | | [0.8: there are no 0.10.0 symbols]
* client: rename connect_unsecure to connect_to_peerUri Lublin2011-07-212-4/+14
| | | | | | | | Both connect_secure() and connect_unsecure() call connect_to_peer(). Prior to this commit spicec.log reported all connections as unsecure, as connect_secure() called connect_unsecure() to make the connection. This fixes RH bug #653545
* Fix spice-server/qemu channel version checksChristophe Fergeau2011-07-211-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When qemu creates a channel, reds.c contains code to check the minor/major channel versions known to QEMU (ie the ones that were current in spice-server when QEMU was compiled) and to compare these versions against the current ones the currently installed spice-server version. According to kraxel [1], the rules for these interface numbers are: "The purpose of the versions is exactly to avoid the need for a new soname. The rules are basically: (1) You add stuff to the interface, strictly append-only to not break binary compatibility. (2) You bump the minor version of the interface. (3) You check the minor version at runtime to figure whenever the added fields contain valid stuff or not. An example is here (core interface, minor goes from 2 to 3, new channel_event callback): http://cgit.freedesktop.org/spice/spice/commit/?id=97f33fa86aa6edd25111b173dc0d9599ac29f879 " The code currently refuses to create a channel if QEMU minor version is less than the current spice-server version. This does not correspond to the intended behaviour, this patch changes to fail is qemu was compiled with a spice-server that is *newer* than the one currently installed. This case is something we cannot support nicely. [1] http://lists.freedesktop.org/archives/spice-devel/2011-July/004440.html
* client: don't crash when agent is missing WAN supportChristophe Fergeau2011-07-211-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you try to connect to a linux guest with WAN options, SPICE window opens up and is blank - it then fails with vdagent timeout message. It should give a warning that this is only applicable for windows guest and still connect to guest. It all starts in RedClient::handle_init This function checks whether we have an agent or not, because if we have an agent, there will be some kind of handshake to check both sides capabilities before all the spice channels are created. When there is no agent running, the startup process goes on with SPICE_MSGC_MAIN_ATTACH_CHANNELS When there is a windows agent running, VD_AGENT_ANNOUNCE_CAPABILITIES and VD_AGENT_DISPLAY_CONFIG messages are sent to the agent, and when processing the agent answer to the VD_AGENT_DISPLAY_CONFIG message, SPICE_MSGC_MAIN_ATTACH_CHANNELS will be sent and the startup process will go on. However, when there is no agent running but --color-depth was used, handle_init won't send the SPICE_MSGC_MAIN_ATTACH_CHANNELS message but will wait for the agent handshake to proceed to its end, which won't happen, so it will timeout waiting for agent answers. Similarly, the linux agent handles VD_AGENT_ANNOUNCE_CAPABILITIES messages, but it doesn't handle VD_AGENT_DISPLAY_CONFIG messages, so we'll never reach the point where a SPICE_MSGC_MAIN_ATTACH_CHANNELS will be sent. This commit fixes this in 2 places: - unconditionnally send SPICE_MSGC_ATTACH_CHANNELS when no agent is running in handle_init - send SPICE_MSGC_MAIN_ATTACH_CHANNELS in RedClient::on_agent_announce_capabilities if the agent doesn't have the VD_AGENT_CAP_DISPLAY_CONFIG capability This fixes RH bug #712938
* client: improve WAN option descriptionChristophe Fergeau2011-07-211-2/+5
| | | | | | | | The WAN options (--color-depth and --disable-effects) need support from the guest agent to be working. Currently they are only supported on Windows. While I don't want to explicitly mention Windows in --help output, we can hint that it won't work with all guests in --help. This fixes RH bug #712941
* x11: don't return freed memory from get_clipboardChristophe Fergeau2011-07-211-2/+6
| | | | | | | | | | | | There is a double free in client/x11/platform.cpp. In get_selection(), in the exit: case with ret_val == -1 and data != NULL, *data_ret (which is returned to the caller) has already been assigned "data", so it will be pointing to freed memory when "data" is XFree'd'. Then in handle_selection_notify, get_selection_free is called on this pointer, which causes a double free. When the length of the read data = 0, set the returned value to NULL, this way subsequent free attempts will be a noop. Fixes RH bug #710461
* client: match delete[] with new[]Christophe Fergeau2011-07-211-1/+1
| | | | | vinfo in x11/platform.cpp is allocated using new[] so it needs to be freed with delete[]
* server: fix access to a released drawable. RHBZ #713474Yonit Halperin2011-07-211-2/+9
| | | | | | | | | red_pipe_add_drawable can lead to removal of drawables from current tree (since it calls red_handle_drawable_surfaces_client_synced), which can also lead to releasing these drawables. Before the fix, red_current_add_equal, called red_pipe_add_drawable, without assuring afterwards that the drawables it refers to are still alive or still in the current tree.
* server: add missing calls to red_handle_drawable_surfaces_client_syncedYonit Halperin2011-07-211-0/+2
| | | | | | red_handle_drawable_surfaces_client_synced was called only from red_pipe_add_drawable, while it should also be called from red_pipe_add_drawable_after. Otherwise, the client might receive a command with a reference to a surface it doesn't hold and crash.
* server: removing local cursor, this solves RHBZ #714801Yonit Halperin2011-07-211-112/+14
| | | | | | | | | | | | | | | When the worker was stoped, the cursor was copied from guest ram to the host ram, and its corresponding qxl command was released. This is unecessary, since the qxl ram still exists (we keep references to the surfaces in the same manner). It also led to BSOD on guest upon migration: the device tracks cursor set commands and it stores a reference to the last one. Then, it replays it to the destination server when migrating to it. However, the command the qxl replayed has already been released from the pci by the original worker, upon STOP. Conflicts: server/red_worker.c