summaryrefslogtreecommitdiffstats
path: root/server/char_device.c
Commit message (Collapse)AuthorAgeFilesLines
* syntax-check: remove trailing whitespacesUri Lublin2013-07-161-2/+2
| | | | Only whitespace changes in this commit.
* syntax-check: make sure config.h is the first included .h fileUri Lublin2013-07-161-0/+1
|
* syntax-check: fix no-newline or empty line at EOFUri Lublin2013-07-161-1/+0
|
* char_device: Don't set active when stopped and don't access dev after unrefHans de Goede2013-03-291-2/+4
| | | | | | | | | | 2 closely related changes in one: 1) When leaving the read or write loop because the chardev has been stopped active should not be updated. It has been set to FALSE by spice_char_device_stop and should stay FALSE 2) The updating of dev->active should be done *before* unref-ing dev Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* char_device: Don't set the write-retry timer when not runningHans de Goede2013-03-291-4/+7
| | | | | | | The write-retry timer should not be set when we're leaving spice_char_device_write_to_device because the char-dev has been stopped. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* char_device: Properly update buffer status when leaving the write loop on stopHans de Goede2013-03-291-4/+1
| | | | | | | | Before this patch the write-loop in spice_char_device_write_to_device would break on running becoming 0, after having written some data, without updating the buffer status, causing the same data to be written *again* when started. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* char_device: Add spice_char_device_write_buffer_get_server_no_token()Hans de Goede2013-03-071-15/+26
| | | | | | | To allow the server to send agent messages without needing to wait for a self-token. IE for sending VD_AGENT_CLIENT_DISCONNECTED messages. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Silence __spice_char_device_write_buffer_get: internal buf is not availableHans de Goede2013-03-041-1/+0
| | | | | | | | | | | | | | | | | These messages are printed when the server tries to push a mouse event to the agent before the previous one has been flushed. This is a normal condition (which gets tracked by the reds->pending_mouse_event boolean), and as such it should *not* trigger the printing of error messages. I've seen these messages occasionally before, but with agent file-xfer they are trivial to trigger, simply send a large file to the agent and while it is transferring move the mouse over the client window. Note that due to the client tokens not allowing the client to completely saturate the agent channel mouse events do still get send to the agent, just with a slightly larger interval. So everything is working as designed and this spice_printerr is just leading to people chasing ghosts. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* 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-261-10/+43
| | | | | | 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
* char_device: don't connect a migrated client if the state of the device ↵Yonit Halperin2012-08-271-8/+14
| | | | | | | | 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.
* char device migration: restore state at destination from migration dataYonit Halperin2012-08-271-0/+49
|
* char device migration: don't read or write from/to the device while waiting ↵Yonit Halperin2012-08-271-5/+19
| | | | for migraion data
* char device migration: marshall migration dataYonit Halperin2012-08-271-0/+69
|
* char_device: variable token price for write buffersYonit Halperin2012-08-271-12/+28
| | | | | | | When restoring migration data, we also restore data that is addressed to the device, and that might have been originated from more than 1 message. When the write buffer that is assoicated with this data is released, we need to free all the relevant tokens.
* reds: add tracking for char devicesYonit Halperin2012-08-271-0/+1
| | | | | | 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.
* char_device: move SpiceCharDeviceState from the headerYonit Halperin2012-07-031-0/+23
| | | | In addition, I also removed the no longer used wakeup callback
* char_device: Introducing shared flow control code for char devices.Yonit Halperin2012-07-031-0/+752
SpiceCharDeviceState manages the (1) write-to-device queue (2) wakeup and reading from the device (3) client tokens (4) sending messages from the device to the client/s, considering the available tokens. SpiceCharDeviceState can be also stopped and started. When the device is stopped, no reading or writing is done from/to the device. Messages addressed from the client to the device are being queued. Later, an api for stop/start will be added to spice.h and it should be called from qemu. This patch does not yet remove the wakeup callback from SpiceCharDeviceState, but once all the char devices (agent/spicevmc/smartcard) code will switch to the new implementation, SpiceCharDeviceState will be moved to the c file and its reference to the wakeup callback will be removed.