summaryrefslogtreecommitdiffstats
path: root/server/reds.c
Commit message (Collapse)AuthorAgeFilesLines
* server: Filter VD_AGENT_MONITORS_CONFIGAlon Levy2012-09-131-1/+52
| | | | | | If the guest supports client monitors config we pass it the VDAgentMonitorsConfig message via the QXLInterface::client_monitors_config api instead of via the vdagent.
* server/reds: reuse already defined localAlon Levy2012-09-131-1/+1
|
* Implement spice_server_set_exit_on_disconnect to enable an option whereby ↵Jeremy White2012-09-051-0/+14
| | | | the spice server shuts down on client disconnect.
* char_device: don't connect a migrated client if the state of the device ↵Yonit Halperin2012-08-271-14/+30
| | | | | | | | might have changed since it was created If reading/writing from the device have occured before migration data has arrived, the migration data might no longer be relvant, and we disconnect the client.
* main: restore state from migration dataYonit Halperin2012-08-271-11/+151
| | | | Also removed old migration leftovers.
* main: send migration dataYonit Halperin2012-08-271-11/+91
| | | | | Also removed some unused definitions from reds that used to belong to old agent and migration code.
* main: send MSG_MIGRATE upon vm migration completionYonit Halperin2012-08-271-0/+44
| | | | | | | | | Before sending the above msg, if there is a pending partial msg that has been read from the agent, we send it to the client. The alternative was to keep the msg as part of the migration data, and then to send it to the destination server via the client and to wait there for the msg chunk completion, before sending it to the client. Of course, the latter is less efficient.
* reds: s/HADER/HEADERYonit Halperin2012-08-271-5/+5
|
* char device migration: don't read or write from/to the device while waiting ↵Yonit Halperin2012-08-271-6/+7
| | | | for migraion data
* replace some migration related spice_error calls with info/warningYonit Halperin2012-08-271-2/+2
|
* seamless migration: migration completion on the destination sideYonit Halperin2012-08-271-9/+33
| | | | | | Tracking the channels that wait for migration data. If there is a new migration process pending, when all the channels have restored their state, we begin the new migration.
* seamleass migration: manage post migration phase in the src sideYonit Halperin2012-08-271-13/+108
| | | | | | | | | | | In semi-seamless, SPICE_MSG_MAIN_MIGRATE_END is sent. In seamless, each channel migrates separately. The src waits till all the clients are disconnected (or a timeout), and then it notifies qemu that spice migration has completed. The patch doesn't include the per-channel logic for seamless migration (sending MSG_MIGRATE, MIGRATE_DATA, etc.).
* seamless migration: pre migration phase on the destination sideYonit Halperin2012-08-271-13/+62
| | | | | | | | | | - handle SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS - reply with SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK/NACK - prepare the channels for migration according to the migration type (semi/seamless) see spice-protocol for more details: commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f
* seamless migration: pre migration phase on the src sideYonit Halperin2012-08-271-2/+6
| | | | | | | | | | | | | | sending SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS and handling SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS The src side signals the client to establish a connection to the destination. In seamless migration, the client is also used to perform a sort of handshake with the destination, for verifying if seamless migration can be supported. see spice-protocol for more details: commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f
* spice.h: add spice_server_set_seamless_migrationYonit Halperin2012-08-271-0/+9
| | | | | | | | | | This new call is used in order to identify whether qemu, or the management (e.g. libvirt), support seamless migration. If it is supported, qemu spice cmd-line configuration should have seamless-migration=on. In addition, we disable seamless migration support if multiple clients are allowed. Currently, only one client is supported.
* 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.
* spice.h: add entries for tracking vm stateYonit Halperin2012-08-271-1/+33
| | | | | | | | | When vm state changes (started/stopped), we notify all the attached SpiceCharDeviceStates about the change. This is mainly required for avoiding writing/reading to/from the device during the non-live stage of migration. spice version will be bumped in one of the following patches.
* reds: add tracking for char devicesYonit Halperin2012-08-271-0/+44
| | | | | | The list of attached char_devices will be used in the next patch for notifying each instance of SpiceCharDeviceState when the vm is started or stopped.
* agent: don't attempt to read from the device if it was releasedYonit Halperin2012-08-271-1/+3
| | | | | if vdi_port_read_buf_process failes, we detach the agent and also release the read buffer. We shouldn't try reading from the device afterwards.
* agent: reset client tokens when notifying on agent connectionYonit Halperin2012-08-271-6/+10
| | | | send SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS
* server/reds: more fixes for wrong spice_error in d2c99b59Alon Levy2012-07-221-68/+68
|
* server/reds: fix wrong spice_error in d2c99b59Alon Levy2012-07-111-26/+26
|
* server/reds.c: spice_printerr cleanupAlon Levy2012-07-051-148/+146
| | | | | | | | | | | | | | | | | | Rules for replacing spice_printerr: * if it's a client drop / agent drop, spice_error * if it's important, spice_warning * else, spice_info. The fourth rule is spice_debug if it's going to fill up the log, but nothing of the sort here. Other things this patch does: * changed reds_show_new_channel to reds_info_new_channel in an attempt to advertise it doesn't always show anything, unless SPICE_DEBUG_LOG_LEVEL >= SPICE_DEVUG_LOG_INFO (==3) * removes two lines of whitespace. * added "crashy" to multiple client warning (only warning introduced, the rest are errors).
* char_device: move SpiceCharDeviceState from the headerYonit Halperin2012-07-031-4/+4
| | | | In addition, I also removed the no longer used wakeup callback
* smartcard: use SpiceCharDeviceState for managing reading from the deviceYonit Halperin2012-07-031-1/+3
| | | | | | | This patch and the following one do not introduce tokening to the smartcard channel. But this can be done easily later, by setting the appropriate variables in SpiceCharDeviceState (after adding the appropriate protocol messages, and implementing this in the client side).
* spicevmc: employ SpiceCharDeviceState for managing reading from the guest deviceYonit Halperin2012-07-031-1/+1
| | | | | | | | This patch and the following one do not introduce tokening to the spicevmc channel. But this can be done easily later, by setting the appropriate variables in SpiceCharDeviceState (after adding the appropriate protocol messages, and implementing this in the client side).
* agent: employ SpiceCharDeviceState for writing to the deviceYonit Halperin2012-07-031-211/+44
|
* agent: use SpiceCharDeviceWriteBuffer for agent data from the clientYonit Halperin2012-07-031-0/+34
| | | | | This is an intermediate patch. The next patch will actually push the buffer to the device, instead of copying it.
* agent: employ SpiceCharDeviceState for managing reading from the deviceYonit Halperin2012-07-031-84/+212
|
* agent: remove save/restore migration data codeYonit Halperin2012-07-031-250/+2
| | | | | | | This code is never called, it was relevant for seamless migration. Most of the data that needs to be migrated was moved to SpiceCharDeviceState. When we implement seamless migration, we will have routines in char_device.c for migrating the relevant data.
* agent: Fix tokens handling in main_channelYonit Halperin2012-07-031-7/+26
| | | | | | | | | | | | - Allow sending tokens to a specific client. - Do not ignore tokens that are sent from the client to the server. The tokens support for multiple clients and for server side tokens is still broken in reds. It will be fixed in following patches, when the server-side agent code will use the SpiceCharDeviceState api. Notice that ignoring the server-side tokens didn't introduce a problem since both the client and the server set it to ~0.
* server/reds: add "usbredir" to recognized channel namesAlon Levy2012-05-071-0/+1
| | | | | | RHBZ: 819484 Signed-off-by: Alon Levy <alevy@redhat.com>
* Avoid jumping across variables declarations with initializersDaniel P. Berrange2012-04-251-1/+2
| | | | | | | | | | If a 'goto' statement jumps across a variable declaration which also has an initializer, the variable is in an undefined state. Splitting the the declaration & initialization doesn't change that, but the compiler can at least now detect use of the unintialized variable Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Convert cases of () to (void)Daniel P. Berrange2012-04-251-1/+1
| | | | | | * server/reds.c, server/smartcard.c: s/()/(void) Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix const-ness violationsDaniel P. Berrange2012-04-251-2/+2
| | | | | | | * server/red_worker.c: Add missing const for return type * server/reds.c: Static strings must be declared const Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* server: export spice_server_is_server_mouse predicateAlon Levy2012-03-261-0/+6
| | | | To be used by qemu query-spice / info spice commands.
* Use the spice-common logging functionsMarc-André Lureau2012-03-251-224/+224
| | | | | It will abort by default for critical level messages. That behaviour can be tuned at runtime.
* Use the spice-common submoduleMarc-André Lureau2012-03-251-8/+8
| | | | | | | | | | | | | | | | | | This patch will replace the common/ directory with the spice-common project. It is for now a simple project subdirectory shared with spice-gtk, but the goal is to make it a proper library later on. With this change, the spice-server build is broken. The following commits fix the build, and have been seperated to ease the review. v2 - moves all the generated marshallers to spice-common library - don't attempt to fix windows VS build, which should somehow be splitted with spice-common (or built from tarball only to avoid generation tools/libs deps) v3 - uses libspice-common-client - fix a mutex.h inclusion reported by Alon
* sasl: small refactoring, check memcheck != NULLMarc-André Lureau2012-03-231-10/+8
|
* Use spice_strdup() to avoid crashing on NULLMarc-André Lureau2012-03-231-6/+6
| | | | | qemu can call spice_server_set_name(s, NULL) when the name is not given. Let's not crash in this case
* server: remove superfluous checkNahum Shalman2012-03-121-3/+0
| | | | no need to duplicate the check that the fd isn't -1
* server: listen on a pre-opened file descriptorNahum Shalman2012-03-121-0/+21
| | | | | | | Allow applications to pre-open a file descriptor and have spice listen on it. Thanks to Daniel Berrange for his comments
* Send name & uuid to capable clientsMarc-André Lureau2012-03-051-0/+20
| | | | | | | | | Add spice_server_set_name() and spice_server_set_uuid() that allows the client to identify a Spice server (useful to associate settings with a particular server) The SPICE_MSG_MAIN_NAME and SPICE_MSG_MAIN_UUID messages are only sent to capable clients, announcing SPICE_MAIN_CAP_NAME_AND_UUID.
* server: more logging about certificates usedChristophe Fergeau2012-03-051-4/+10
| | | | | | | This commit adds some log messages indicating which certificates could be loaded (or not). Fixes rhbz#787678
* Add log for invalid/expired ticketsChristophe Fergeau2012-03-051-0/+5
| | | | | | | Currently, when a ticket has already expired, or is invalid, there is no qemu log to tell what went wrong. This commit adds such a log. Fixes rhbz#787669
* Respect IOV_MAX if definedDan McGee2012-02-211-1/+26
| | | | | | | | | | | Solaris has a pitiful maximum writev vector size of only 16, so the ping request at initial startup destroyed this call and broke things immediately. Reimplement stream_writev_cb() to respect IOV_MAX and break the writev() calls into chunks as necessary. Care was taken to return the correct values as necessary so the EAGAIN handling logic can determine where to resume the writev call the next time around. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
* red_worker: reimplement event loop using poll()Dan McGee2012-02-211-0/+1
| | | | | | | | | | | | | | | | | | This removes the epoll dependency we had in red_worker, which was the last Linux-specific call we were using in the entire Spice server. Given we never have more than 10 file descriptors involved, there is little performance gain had here by using epoll() over poll(). The biggest change is introduction of a new pre_disconnect callback; this is because poll, unlike epoll, cannot automatically remove file descriptors as they are closed from the pollfd set. This cannot be done in the existing on_disconnect callback; that is too late as the stream has already been closed and the file descriptor lost. The on_disconnect callback can not be moved before the close and other operations easily because of some behavior that relies on client_num being set to a certain value. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
* server, separate SpiceChannelEventInfo from RedStreamAlon Levy2012-02-151-21/+22
| | | | | | | | | | fixes rhbz 790749 use after free of SpiceChannelEventInfo. The lifetime of the SpiceChannelEventInfo was that of RedsStream, but it is used by main_dispatcher_handle_channel_event after the RedsStream is freed for the cursor and display channels. Making SCEI allocation be at RedsStream allocation, and deallocation after the DESTROY event is processed by core->channel_event, fixes use after free.
* Add casts for compatibility purposesDan McGee2012-02-141-1/+1
| | | | | | | | | | | Some non-Linux platforms return a (caddr_t *) result for the return value of mmap(), which is very unfortunate. Add a (void *) cast to explicitly avoid the warning when compiling with -Werror. For the IO vector related stuff, signed vs. unsigned comes into play so adding a (void *) cast here is technically correct for all platforms. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
* server: support IPV6 addresses in channel events sent to qemuYonit Halperin2012-02-121-4/+17
| | | | | | | | | RHBZ #788444 CC: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Yonit Halperin <yhalperi@redhat.com>