[Spice-devel] Fwd: [PATCH v2] spice-vmc: add a reset handler used to unregister spice interface (and trigger server mouse)

Alon Levy alevy at redhat.com
Wed Sep 1 06:14:06 PDT 2010


bump - any reviewers? Gerd?

----- Forwarded Message -----
From: "Alon Levy" <alevy at redhat.com>
To: "spice-devel" <spice-devel at freedesktop.org>
Sent: Tuesday, August 31, 2010 2:57:43 PM (GMT+0200) Auto-Detected
Subject: [Spice-devel] [PATCH v2] spice-vmc: add a reset handler used to unregister spice interface (and trigger server mouse)

v2:
 use qdev.reset instead of old API.

diff --git a/hw/spice-vmc.c b/hw/spice-vmc.c
index 434c70f..0636973 100644
--- a/hw/spice-vmc.c
+++ b/hw/spice-vmc.c
@@ -189,6 +189,15 @@ static void vmc_print_optional_subtypes(void)
     fprintf(stderr, "\n");
 }
 
+static void vmc_reset(DeviceState *opaque)
+{
+    VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, opaque);
+    SpiceVirtualChannel *svc = DO_UPCAST(SpiceVirtualChannel, port, port);
+
+    dprintf(svc, 1, "%s\n", __func__);
+    vmc_unregister_interface(svc);
+}
+
 static int vmc_initfn(VirtIOSerialDevice *dev)
 {
     VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, &dev->qdev);
@@ -241,6 +250,7 @@ static int vmc_exitfn(VirtIOSerialDevice *dev)
 static VirtIOSerialPortInfo vmc_info = {
     .qdev.name     = VMC_DEVICE_NAME,
     .qdev.size     = sizeof(SpiceVirtualChannel),
+    .qdev.reset    = vmc_reset,
     .init          = vmc_initfn,
     .exit          = vmc_exitfn,
     .guest_open    = vmc_guest_open,
_______________________________________________
Spice-devel mailing list
Spice-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list