diff options
| author | Gerd Hoffmann <kraxel@redhat.com> | 2010-04-19 21:39:14 +0200 |
|---|---|---|
| committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-05-19 11:22:07 +0200 |
| commit | ccfbbae513adb4aeaea1c9e09be7e0a23d8aeded (patch) | |
| tree | f01037c4a04d2521e30b5bc5dd550188c5cdbbe8 /server/vd_interface.h | |
| parent | 2e47435ecbe3d163fa9607deaa972ea4aecdbbf4 (diff) | |
| download | spice-ccfbbae513adb4aeaea1c9e09be7e0a23d8aeded.tar.gz spice-ccfbbae513adb4aeaea1c9e09be7e0a23d8aeded.tar.xz spice-ccfbbae513adb4aeaea1c9e09be7e0a23d8aeded.zip | |
vdi port: redesign.
Pretty straight forward.
One thing we should think about is if and how we are going to deal
with multiple ports here?
With vdi port using virtio-serial as communication channel to the guest
it is easy to have multiple ports, i.e. we might want to use a second
instance for clipboard data. That implies that we need support for
multiple channels all the way through the stack ...
Diffstat (limited to 'server/vd_interface.h')
| -rw-r--r-- | server/vd_interface.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/server/vd_interface.h b/server/vd_interface.h index 78f0f626..0f26822d 100644 --- a/server/vd_interface.h +++ b/server/vd_interface.h @@ -367,27 +367,28 @@ void spice_server_record_stop(SpiceRecordInstance *sin); uint32_t spice_server_record_get_samples(SpiceRecordInstance *sin, uint32_t *samples, uint32_t bufsize); -#define VD_INTERFACE_VDI_PORT "vdi_port" -#define VD_INTERFACE_VDI_PORT_MAJOR 1 -#define VD_INTERFACE_VDI_PORT_MINOR 1 -typedef struct VDIPortInterface VDIPortInterface; +#define SPICE_INTERFACE_VDI_PORT "vdi_port" +#define SPICE_INTERFACE_VDI_PORT_MAJOR 1 +#define SPICE_INTERFACE_VDI_PORT_MINOR 1 +typedef struct SpiceVDIPortInterface SpiceVDIPortInterface; +typedef struct SpiceVDIPortInstance SpiceVDIPortInstance; +typedef struct SpiceVDIPortState SpiceVDIPortState; + +struct SpiceVDIPortInterface { + SpiceBaseInterface base; -typedef struct VDIPortPlug VDIPortPlug; -struct VDIPortPlug { - uint32_t minor_version; - uint32_t major_version; - void (*wakeup)(VDIPortPlug *plug); + void (*state)(SpiceVDIPortInstance *sin, int connected); + int (*write)(SpiceVDIPortInstance *sin, const uint8_t *buf, int len); + int (*read)(SpiceVDIPortInstance *sin, uint8_t *buf, int len); }; -struct VDIPortInterface { - SpiceBaseInterface base; - - VDObjectRef (*plug)(VDIPortInterface *port, VDIPortPlug* plug); - void (*unplug)(VDIPortInterface *port, VDObjectRef plug); - int (*write)(VDIPortInterface *port, VDObjectRef plug, const uint8_t *buf, int len); - int (*read)(VDIPortInterface *port, VDObjectRef plug, uint8_t *buf, int len); +struct SpiceVDIPortInstance { + SpiceBaseInstance base; + SpiceVDIPortState *st; }; +void spice_server_vdi_port_wakeup(SpiceVDIPortInstance *sin); + #define VD_INTERFACE_NET_WIRE "net_wire" #define VD_INTERFACE_NET_WIRE_MAJOR 1 #define VD_INTERFACE_NET_WIRE_MINOR 1 |
