[Spice-devel] [PATCH 1/2] spice-{vdi, vmc}: rename SpiceVDIPort* to SpiceCharDevice*

Alon Levy alevy at redhat.com
Thu Aug 26 01:46:16 PDT 2010


---
 hw/spice-vdi.c |   16 ++++++++--------
 hw/spice-vmc.c |   22 +++++++++++-----------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/hw/spice-vdi.c b/hw/spice-vdi.c
index 23cbbe1..415932b 100644
--- a/hw/spice-vdi.c
+++ b/hw/spice-vdi.c
@@ -104,7 +104,7 @@ typedef struct PCIVDIPortDevice {
     int running;
     int new_gen_on_resume;
     int active_interface;
-    SpiceVDIPortInstance sin;
+    SpiceCharDeviceInstance sin;
     int plug_read_pos;
 } PCIVDIPortDevice;
 
@@ -178,7 +178,7 @@ static void vdi_port_notify_guest(PCIVDIPortDevice *d)
     vdi_port_set_dirty(d, &d->ram->int_pending, sizeof(d->ram->int_pending));
 }
 
-static int vdi_port_interface_write(SpiceVDIPortInstance *sin,
+static int vdi_port_interface_write(SpiceCharDeviceInstance *sin,
                                     const uint8_t *buf, int len)
 {
     PCIVDIPortDevice *d = container_of(sin, PCIVDIPortDevice, sin);
@@ -224,7 +224,7 @@ static int vdi_port_interface_write(SpiceVDIPortInstance *sin,
     return actual_write;
 }
 
-static int vdi_port_interface_read(SpiceVDIPortInstance *sin,
+static int vdi_port_interface_read(SpiceCharDeviceInstance *sin,
                                    uint8_t *buf, int len)
 {
     PCIVDIPortDevice *d = container_of(sin, PCIVDIPortDevice, sin);
@@ -290,11 +290,11 @@ static int vdi_port_interface_read(SpiceVDIPortInstance *sin,
     return actual_read;
 }
 
-static SpiceVDIPortInterface vdi_port_interface = {
-    .base.type          = SPICE_INTERFACE_VDI_PORT,
+static SpiceCharDeviceInterface vdi_port_interface = {
+    .base.type          = SPICE_INTERFACE_CHAR_DEVICE,
     .base.description   = "vdi port",
-    .base.major_version = SPICE_INTERFACE_VDI_PORT_MAJOR,
-    .base.minor_version = SPICE_INTERFACE_VDI_PORT_MINOR,
+    .base.major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
+    .base.minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
 
     .write              = vdi_port_interface_write,
     .read               = vdi_port_interface_read,
@@ -354,7 +354,7 @@ static void vdi_port_dev_disconnect(PCIVDIPortDevice *d)
 
 static void vdi_port_dev_notify(PCIVDIPortDevice *d)
 {
-    spice_server_vdi_port_wakeup(&d->sin);
+    spice_server_char_device_wakeup(&d->sin);
 }
 
 static void vdi_port_write_dword(void *opaque, uint32_t addr, uint32_t val)
diff --git a/hw/spice-vmc.c b/hw/spice-vmc.c
index f52ed19..c58799e 100644
--- a/hw/spice-vmc.c
+++ b/hw/spice-vmc.c
@@ -35,7 +35,7 @@
 typedef struct SpiceVirtualChannel {
     VirtIOSerialPort      port;
     VMChangeStateEntry    *vmstate;
-    SpiceVDIPortInstance  sin;
+    SpiceCharDeviceInstance  sin;
     bool                  active;
     uint8_t               *buffer;
     uint8_t               *datapos;
@@ -43,7 +43,7 @@ typedef struct SpiceVirtualChannel {
     uint32_t              debug;
 } SpiceVirtualChannel;
 
-static int vmc_write(SpiceVDIPortInstance *sin, const uint8_t *buf, int len)
+static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
 {
     SpiceVirtualChannel *svc = container_of(sin, SpiceVirtualChannel, sin);
     ssize_t out = 0;
@@ -66,7 +66,7 @@ static int vmc_write(SpiceVDIPortInstance *sin, const uint8_t *buf, int len)
     return out;
 }
 
-static int vmc_read(SpiceVDIPortInstance *sin, uint8_t *buf, int len)
+static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
 {
     SpiceVirtualChannel *svc = container_of(sin, SpiceVirtualChannel, sin);
     int bytes = MIN(len, svc->datalen);
@@ -86,11 +86,11 @@ static int vmc_read(SpiceVDIPortInstance *sin, uint8_t *buf, int len)
     return bytes;
 }
 
-static SpiceVDIPortInterface vmc_interface = {
-    .base.type          = SPICE_INTERFACE_VDI_PORT,
-    .base.description   = "spice virtual channel vdi port",
-    .base.major_version = SPICE_INTERFACE_VDI_PORT_MAJOR,
-    .base.minor_version = SPICE_INTERFACE_VDI_PORT_MINOR,
+static SpiceCharDeviceInterface vmc_interface = {
+    .base.type          = SPICE_INTERFACE_CHAR_DEVICE,
+    .base.description   = "spice virtual channel char device",
+    .base.major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
+    .base.minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
     .write              = vmc_write,
     .read               = vmc_read,
 };
@@ -122,7 +122,7 @@ static void vmc_change_state_handler(void *opaque, int running, int reason)
     SpiceVirtualChannel *svc = opaque;
 
     if (running && svc->active) {
-        spice_server_vdi_port_wakeup(&svc->sin);
+        spice_server_char_device_wakeup(&svc->sin);
     }
 }
 
@@ -152,7 +152,7 @@ static void vmc_guest_ready(VirtIOSerialPort *port)
 
     dprintf(svc, 1, "%s\n", __func__);
     if (svc->active)
-        spice_server_vdi_port_wakeup(&svc->sin);
+        spice_server_char_device_wakeup(&svc->sin);
 }
 
 static void vmc_have_data(VirtIOSerialPort *port, const uint8_t *buf, size_t len)
@@ -169,7 +169,7 @@ static void vmc_have_data(VirtIOSerialPort *port, const uint8_t *buf, size_t len
     svc->datapos = svc->buffer;
     svc->datalen = len;
     virtio_serial_throttle_port(&svc->port, true);
-    spice_server_vdi_port_wakeup(&svc->sin);
+    spice_server_char_device_wakeup(&svc->sin);
 }
 
 static void vmc_reset(DeviceState *opaque)
-- 
1.7.2



More information about the Spice-devel mailing list