summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-08-24 17:32:44 +0300
committerAlon Levy <alevy@redhat.com>2010-08-31 14:57:03 +0300
commit7624f57f66dd9ca83f0e72957d489f3b3911f310 (patch)
tree2addb4aa832987feb0cccafb5ed6c611f5321486
parentec545d35e836715961f33abb4cc68d16265fe080 (diff)
spice-vmc: add a reset handler used to unregister spice interface (and trigger server mouse)spice-vmc.resethandler.v1
-rw-r--r--hw/spice-vmc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/spice-vmc.c b/hw/spice-vmc.c
index 434c70fa3..0636973d3 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,