summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Release 0.12.2v0.12.2Hans de Goede2012-12-202-0/+11
|
* red_parse_qxl: fix throwing away drawables that have masksYonit Halperin2012-12-202-19/+16
| | | | | | | Non rgb bitmaps are allowed to not have a palette in case they are masks (which are 1BIT bitmaps). Related: rhbz#864982
* spice-client: Add --hotkeys cmdline optionHans de Goede2012-12-191-0/+7
| | | | | | | To allow using the existing mechanism to override the default hotkeys from the cmdline. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* reds: Use g_strlcpy instead of strncpyChristophe Fergeau2012-12-121-15/+17
| | | | | | | | | reds.c is using strncpy with a length one byte less than the destination buffer size, and is relying on the fact that the destination buffers are static global variables. Now that we depend on glib, we can use g_strlcpy instead, which avoids relying on such a subtle trick to get a nul-terminated string.
* build: Use glib2Christophe Fergeau2012-12-122-0/+5
| | | | | Now that QEMU depends on glib, it won't really hurt if we depend on it as well, and we won't have to reinvent our own helpers.
* Don't build client by defaultChristophe Fergeau2012-12-121-1/+1
| | | | It has been superseded by virt-viewer/remote-viewer
* Fail reds_init_socket when getaddrinfo failsChristophe Fergeau2012-12-121-0/+1
| | | | | | We currently output a warning when getaddrinfo fails, but then we go on trying to use the information it couldn't read. Make sure we bail out of reds_init_socket if getaddrinfo fails.
* Make sure strncpy'ed string are 0-terminatedChristophe Fergeau2012-12-121-2/+2
| | | | | | | | | | spice_server_set_ticket and spice_server_set_addr get (library) user-provided strings as arguments, and copy them to fixed-size buffers using strncpy. However, if these strings are too long, the copied string will not be 0-terminated, which will cause issues later. This commit copies one byte less than the size of the destination buffer. In both cases, this buffer is a static global variable, so its memory will be set to 0.
* red_worker: revert 8855438aYonit Halperin2012-12-051-5/+0
| | | | | | | | | | | | | | | | | | | red_proccess_commands calls were added after calling guest_set_client_capabilities in order to cleanup the command ring from old commands that the client might not be able to handle. However, calling red_process_commands at this stage does send messages to the client. In addition, since setting the client capabilities at the guest is not synchronized, emptying the command ring is not enough in order to make sure the following commands will be supported by the client. The call to red_proccess_commands before initializing the display streams (the call to red_display_start_streams), caused inconsistencies related to video streaming upon reconnecting (rhbz#883564). I'm reverting this patch till another solution for the capabilities mismatch is introduced. Resolves: rhbz#883564
* server: add "port" channel supportMarc-André Lureau2012-12-054-18/+155
| | | | | | | | | | | | | | | | | A Spice port channel carry arbitrary data between the Spice client and the Spice server. It may be used to provide additional services on top of a Spice connection. For example, a channel can be associated with the qemu monitor for the client to interact with it, just like any qemu chardev. Or it may be used with various protocols, such as the Spice Controller. A port kind is identified simply by its fqdn, such as org.qemu.monitor, org.spice.spicy.test or org.ovirt.controller... The channel is based on Spicevmc which simply tunnels data between client and server, with a few additional messages. See the description of the channel protocol in spice-common history.
* server: bump SPICE_SERVER_VERSION to 0.12.2Marc-André Lureau2012-12-051-1/+1
|
* update spice-commonMarc-André Lureau2012-12-051-0/+0
|
* agent: fix mishandling of agent data received from the client after agent ↵Yonit Halperin2012-11-301-6/+22
| | | | | | | | | | | | | | disconnection The server can receive from the client agent data even when the agent is disconnected. This can happen if the client sends the agent data before it receives the AGENT_DISCONNECTED msg. We should receive and handle such msgs, instead of disconnecting the client. This bug can also lead to a server crash if the agent gets reconnected fast enough, and it receives an agent data msg from the client before MSGC_AGENT_START. upstream bz#55726 rhbz#881980
* red_worker: no need to align the stride of internal imagesYonit Halperin2012-11-291-1/+1
| | | | | Internal images are just read from the surface, compressed, and sent to the client. Then, they are destroyed. I can't find any reason for aligning their memory.
* red_worker: fix sending internal images with stride > bpp*width to lz ↵Yonit Halperin2012-11-281-13/+13
| | | | | | | | | | compression rhbz#876685 The current lz implementation does not support such bitmaps. The following patch will actually prevent allocating stride > bpp*width for internal images.
* red_worker.c: fix memory corruption when data from client is bigger than ↵Yonit Halperin2012-11-261-0/+12
| | | | | | | | | 1024 bytes Previously, there was no check for the size of the message received from the client, and all messages were read into a buffer of size 1024. However, migration data can be bigger than 1024. In such cases, memory corruption occurred.
* red_worker.c: fix not sending all pending messages when the device is stoppedYonit Halperin2012-11-261-21/+25
| | | | | | | | | | | | | | | | | | | | | red_wait_outgoing_item only waits till the currently outgoing msg is completely sent. red_wait_outgoing_items does the same for multi-clients. handle_dev_stop erroneously called red_wait_outgoing_items, instead of waiting till all the items in the pipes are sent. This waiting is necessary because after drawables are sent to the client, we release them from the device. The device might have been stopped due to moving to the non-live phase of migration. Accessing the device memory during this phase can lead to inconsistencies. Also, MSG_MIGRATE should be the last message sent to the client, before MSG_MIGRATE_DATA. Due to this bug, msgs were marshalled and sent after handle_dev_stop and after handle_dev_display_migrate which sometimes led to the release of surfaces, and inserting MSG_DISPLAY_DESTROY_SURFACE after MSG_MIGRATE. This patch also removes the calls to red_wait_outgoing_items, from dev_flush_surfaces. They were unnecessary.
* smartcard.c: avoid marshalling migration data with reference to a memory ↵Yonit Halperin2012-11-261-1/+1
| | | | | | | | | that might be released before send has completed The current solution just copy the buffer. Currently data that is read from the guest is always copied before sending it to the client. When we will have ref count for these buffers, we can also use it for marshalling the migration data.
* red_worker.c: fix marshalling of migration dataYonit Halperin2012-11-261-6/+5
| | | | fix calling spice_marhsaller_add_ref with memory on stack
* reds.c: fix calls to spice_marshaller_add_ref with ptr to memory that might ↵Yonit Halperin2012-11-261-10/+14
| | | | be released before sending
* char_device.c: when the state is destroyed, also free the buffer that is ↵Yonit Halperin2012-11-261-0/+3
| | | | being written to the device
* char_device.c: add ref count for write-to-device buffersYonit Halperin2012-11-262-10/+44
| | | | | | The ref count is used in order to keep buffers that were in the write queue and now are part of migration data, in case the char_device state is destroyed before we complete sending the migration data.
* char_device.c: fix call to spice_marshaller_add_ref with memory on stackYonit Halperin2012-11-211-6/+8
| | | | rhbz#862352
* red_worker.c: fix calling set_client_capabilities when it is unsupported by qemuYonit Halperin2012-11-121-10/+8
| | | | | | The erroneous call was in handle_dev_start. This patch also fixes not calling set_client_capabilities when the qxl major_version is > 3.
* display seamless migration: no need to trace the generation of the primary ↵Yonit Halperin2012-11-121-35/+16
| | | | | | | surface We no longer process destroy_primary or destroy_surfaces while waiting for migration data.
* display seamless migration: don't process both cmd ring and dispatcher queue ↵Yonit Halperin2012-11-121-7/+36
| | | | | | | | | | | | | | | | | | till migration data is received fix: rhbz#866929 At migration destination side, we need to restore the client's surfaces state, before sending surfaces related messages. Before this patch, we stopped the processing of only the cmd ring, till migration data arrived. However, some QXL_IOs require reading and rendering the cmd ring (e.g., update_area). Moreover, when the device is reset, after destroying all surfaces, we assert (in qemu) if the cmd ring is not empty (see rhbz#866929). This fix makes the red_worker thread wait till the migration data arrives (or till a timeout), and not process any input from the device after the vm is started.
* Revert "server: add websockets support via libwebsockets"Alon Levy2012-11-0410-471/+32
| | | | This reverts commit 63bb37276e028ab1b1c156c9e7907bf22b6d5952.
* update spice-common (was broken)Alon Levy2012-11-041-0/+0
|
* server/red_worker: don't call set_client_capabilities if vm is stoppedAlon Levy2012-11-011-18/+46
| | | | | | | | | We try to inject an interrupt to the vm in this case, which we cannot do if it is stopped. Instead log this and update when vm restarts. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=870972 (that bz is on qemu, it will be cloned or just changed, not sure yet)
* server/red_worker: wip: VALIDATE_SURFACE macros, remove asserts (but too ↵Alon Levy2012-10-251-12/+50
| | | | late - should be done earlier)
* release 0.12.1Alon Levy2012-10-252-3/+3
|
* server: add websockets support via libwebsocketsAlon Levy2012-10-2510-32/+471
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New API: spice_server_set_ws_ports This adds an optional dependency on libwebsockets. You need to get my patched 0.0.3 version here: git://people.freedesktop.org/~alon/libwebsockets There is no qemu patches yet, to test change in reds.c the default value of spice_ws_port to 5959 (for the default of spice-html5). For testing there is an online client at http://spice-space.org/spice-html5/spice.html Known issues: 1. The tester (server/tests/test_display_no_ssl) gets into dropping all data after a few seconds, I think it's an issue with the implemented watches, but haven't figured it out. 2. libwebsocket's read interface is inverted to what our code expects, i.e. there is no libwebsocket_read, so there is an additional copy involved (see RedsWebSocket). This can be fixed. 3. Listening on a separate port. Since the headers are different, we could listen on the same port (first three bytes RED/GET). I don't know if we want to? Todos: 1. SSL not implemented yet. Needs some thought as to how. 2. Serve spice-html5 when accessed as a http server. Nice to have.
* server/red_worker: stride > 0 is tested, remove abortAlon Levy2012-10-251-3/+0
| | | | Tested using the wip driver and xf86-video-modesetting.
* server/tests/test_display_base: fix segfault in testAlon Levy2012-10-251-1/+5
|
* server/reds.c: split off reds-private.hAlon Levy2012-10-252-176/+186
|
* configure.ac: add libcacard to SPICE_REQUIRES if built with smartcard supportAlon Levy2012-10-251-0/+1
|
* update spice-commonAlon Levy2012-10-251-0/+0
|
* server: red_dispatcher: check major/minor of qxl for client_monitors_configUri Lublin2012-10-241-14/+7
| | | | | | | | This solves a problem with new spice-server and old qemu-kvm, where spice thinks qif->client_monitors_config exists, while it does not exist in qemu-kvm. Also "major > required_major" was added to the condition. Also only the specific RedDispatcher is checked (and not all dispatchers).
* add git-version-gen and gitlog-to-changelogAlon Levy2012-10-195-11/+385
|
* inputs_channel: Fix wrong handling of key up/down on big endianHans de Goede2012-10-181-5/+7
| | | | | | | | | The client will send 0x000000## codes for regular keys, and 0x0000##e0 codes for extended keys. The current code which simply walks the uint32_t code in memory order relies on the memory order being little endian, which will clearly fail on big endian machines, this fixes this. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* snd channel: fix accessing freed memoryYonit Halperin2012-10-111-2/+2
| | | | | snd_channel_put freed "channel", and then channel->worker was accessed. It caused segmentation faults during connections and disconnections of the client.
* Fix PlaybackChannel forward declarationChristophe Fergeau2012-10-011-3/+2
| | | | | | | This caused a jenkins build failure: snd_worker.c:148: error: redefinition of typedef 'PlaybackChannel' snd_worker.c:126: note: previous declaration of 'PlaybackChannel' was here
* server: Access the correct SndChannel for a given AudioFrameAndrew Eikum2012-10-011-5/+11
| | | | | | The client of _get_buffer() holds a ref to the SndChannel, and we should access that SndChannel when _put_samples() is called, not the one that happens to currently be attached to the Interface.
* server: Don't release SndChannel twice from worker referenceAndrew Eikum2012-10-011-1/+1
| | | | | | | | When we release the SndChannel reference during snd_disconnect_channel(), we need to set the pointer to NULL so it doesn't get released again on client reconnect during snd_set_playback_peer(). This can happen when a reference is held from _playback_get_buffer().
* reds: Report an error when reds_char_device_add_state failsChristophe Fergeau2012-09-201-0/+1
| | | | | | This used to abort with spice_error. The caller currently does not check spice_server_char_device_add_interface return value, but it's still cleaner to report an error in this case.
* reds: Check errors returned from SSL_CTX_set_cipher_listChristophe Fergeau2012-09-201-1/+3
|
* reds: Report errors from load_dh_paramsChristophe Fergeau2012-09-201-3/+10
|
* reds: Check reds_init_ssl errorsChristophe Fergeau2012-09-201-1/+3
| | | | | | Now that this function can fail, propagate any error up to the caller. This allows qemu to fail when an SSL initialization error occurred.
* reds: report SSL initialization errorsChristophe Fergeau2012-09-201-1/+7
| | | | | | | | | Errors occurring in reds_init_ssl used to be fatal through the use of spice_error, but this was downgraded to non-fatal spice_warning calls recently. This means we no longer error out when invalid SSL (certificates, ...) parameters are passed by the user. This commit changes reds_init_ssl return value from void to int so that errors can be reported to the caller.
* reds_init_net: report errors on watch setup failuresChristophe Fergeau2012-09-201-0/+3
| | | | | | | | | | We used to be aborting in such situations, but this was changed during the big spice_error/printerr cleanup. We are currently outputting a warning but not reporting the error with the caller when reds_init_net fails to register listening watches with the mainloop. As it's unlikely that things will work as expected in such cases, better to error out of the function instead of pretending everything is all right.