[Spice-devel] [PATCH spice-server 00/14] char device flow control

Yonit Halperin yhalperi at redhat.com
Wed Jun 27 08:16:38 PDT 2012


Hi,

This patch series extends SpiceCharDeviceState to manage the character devices flow control:
wakeup and reading from the device; writing to the device; start/stop the device; server/client tokens
management, including partial support for multiple clients.
The agent, spicevmc, and smartcard, were modified to use SpiceCharDeviceState.

Functional differences from the previous implementation:
(1) Api for starting and stopping the device: when the device is stopped, incoming messages from the client are kept in the
server till the device is started (or migrated - not implemented yet).
(2) vdagent: not ignoring tokens received from the client; generalize token management for multiple clients.
(3) smartcard, spicevmc: 
    (a) support partial writes; while this might not be necessary for usbredir, it may be required for future devices.
    (b) smartcard and spicevmc channels can be easily extended to support tokening.

The patches serve also as a preliminary work for supporting seamless migration by:
(1) having start/stop api: we need to stop writing to the guest when savevm starts
(2) having write queues for all character devices and not just the agent:
    we need to save data that reached the server after the guest was stopped.
(3) having tokens support: in addition to the ongoing flow control it provides,
    it also allows us to set an upper limit to the amount of data we might need to migrate.

The series also contain some bug fixes.

Regards,
Yonit.

Yonit Halperin (14):
  smartcard: fix calc of remaining data size when reading more than one
    msg from the device
  smartcard: fix an error message
  char_device: Introducing shared flow control code for char devices.
  agent: Fix tokens handling in main_channel
  agent: remove save/restore migration data code
  agent: employ SpiceCharDeviceState for managing reading from the
    device
  agent: use SpiceCharDeviceWriteBuffer for agent data from the client
  agent: employ SpiceCharDeviceState for writing to the device
  spicevmc: employ SpiceCharDeviceState for managing reading from the
    guest device
  spicevmc: use SpiceCharDeviceState for writing to the guest device
  smartcard: use SpiceCharDeviceState for managing reading from the
    device
  smartcard: creating SmartCardChannelClient type
  smartcard: use SpiceCharDeviceState for writing to the guest device
  char_device: move SpiceCharDeviceState from the header

 server/Makefile.am    |    1 +
 server/char_device.c  |  762 ++++++++++++++++++++++++++++++++++++++++++++
 server/char_device.h  |  182 +++++++++++-
 server/main_channel.c |   94 +++----
 server/main_channel.h |    6 +-
 server/reds.c         |  841 ++++++++++++++++++-------------------------------
 server/reds.h         |    5 +-
 server/smartcard.c    |  367 ++++++++++++++++------
 server/smartcard.h    |    6 +-
 server/spicevmc.c     |  193 ++++++++----
 10 files changed, 1698 insertions(+), 759 deletions(-)
 create mode 100644 server/char_device.c

-- 
1.7.7.6



More information about the Spice-devel mailing list