dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0009-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch

bacd9b
From b4ea3493c8c99bd854eec8640bd5c90c31e8ac14 Mon Sep 17 00:00:00 2001
298366
From: Paolo Bonzini <pbonzini@redhat.com>
298366
Date: Fri, 20 Sep 2013 16:57:55 +0200
298366
Subject: [PATCH] virtio-serial: switch exit callback to VirtioDeviceClass
298366
298366
This ensures hot-unplug is handled properly by the proxy.
298366
298366
Cc: qemu-stable@nongnu.org
298366
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
298366
---
298366
 hw/char/virtio-serial-bus.c | 10 ++++------
298366
 1 file changed, 4 insertions(+), 6 deletions(-)
298366
298366
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
45bdef
index 703f026..a7ede90 100644
298366
--- a/hw/char/virtio-serial-bus.c
298366
+++ b/hw/char/virtio-serial-bus.c
298366
@@ -987,12 +987,11 @@ static const TypeInfo virtio_serial_port_type_info = {
298366
     .class_init = virtio_serial_port_class_init,
298366
 };
298366
 
298366
-static int virtio_serial_device_exit(DeviceState *dev)
298366
+static void virtio_serial_device_exit(VirtIODevice *vdev)
298366
 {
298366
-    VirtIOSerial *vser = VIRTIO_SERIAL(dev);
298366
-    VirtIODevice *vdev = VIRTIO_DEVICE(dev);
298366
+    VirtIOSerial *vser = VIRTIO_SERIAL(vdev);
298366
 
298366
-    unregister_savevm(dev, "virtio-console", vser);
298366
+    unregister_savevm(DEVICE(vdev), "virtio-console", vser);
298366
 
298366
     g_free(vser->ivqs);
298366
     g_free(vser->ovqs);
298366
@@ -1004,7 +1003,6 @@ static int virtio_serial_device_exit(DeviceState *dev)
298366
         g_free(vser->post_load);
298366
     }
298366
     virtio_cleanup(vdev);
298366
-    return 0;
298366
 }
298366
 
298366
 static Property virtio_serial_properties[] = {
298366
@@ -1016,10 +1014,10 @@ static void virtio_serial_class_init(ObjectClass *klass, void *data)
298366
 {
298366
     DeviceClass *dc = DEVICE_CLASS(klass);
298366
     VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
298366
-    dc->exit = virtio_serial_device_exit;
298366
     dc->props = virtio_serial_properties;
298366
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
298366
     vdc->init = virtio_serial_device_init;
298366
+    vdc->exit = virtio_serial_device_exit;
298366
     vdc->get_features = get_features;
298366
     vdc->get_config = get_config;
298366
     vdc->set_config = set_config;