[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 07/51] virtio-serial: switch exit callback to Virti
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 07/51] virtio-serial: switch exit callback to VirtioDeviceClass |
Date: |
Fri, 21 Feb 2014 02:16:43 -0600 |
From: Paolo Bonzini <address@hidden>
This ensures hot-unplug is handled properly by the proxy, and avoids
leaking bus_name which is freed by virtio_device_exit.
Cc: address@hidden
Acked-by: Andreas Faerber <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
(cherry picked from commit 0e86c13fe2058adb8c792ebb7c51a6a7ca9d3d55)
Signed-off-by: Michael Roth <address@hidden>
---
hw/char/virtio-serial-bus.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index 703f026..a7ede90 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -987,12 +987,11 @@ static const TypeInfo virtio_serial_port_type_info = {
.class_init = virtio_serial_port_class_init,
};
-static int virtio_serial_device_exit(DeviceState *dev)
+static void virtio_serial_device_exit(VirtIODevice *vdev)
{
- VirtIOSerial *vser = VIRTIO_SERIAL(dev);
- VirtIODevice *vdev = VIRTIO_DEVICE(dev);
+ VirtIOSerial *vser = VIRTIO_SERIAL(vdev);
- unregister_savevm(dev, "virtio-console", vser);
+ unregister_savevm(DEVICE(vdev), "virtio-console", vser);
g_free(vser->ivqs);
g_free(vser->ovqs);
@@ -1004,7 +1003,6 @@ static int virtio_serial_device_exit(DeviceState *dev)
g_free(vser->post_load);
}
virtio_cleanup(vdev);
- return 0;
}
static Property virtio_serial_properties[] = {
@@ -1016,10 +1014,10 @@ static void virtio_serial_class_init(ObjectClass
*klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
- dc->exit = virtio_serial_device_exit;
dc->props = virtio_serial_properties;
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
vdc->init = virtio_serial_device_init;
+ vdc->exit = virtio_serial_device_exit;
vdc->get_features = get_features;
vdc->get_config = get_config;
vdc->set_config = set_config;
--
1.7.9.5
- [Qemu-stable] Patch Round-up for stable 1.7.1, freeze on 2013-02-27, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 02/51] virtio-bus: remove vdev field, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 01/51] virtio-ccw: move virtio_ccw_stop_ioeventfd to virtio_ccw_busdev_unplug, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 03/51] virtio-ccw: remove vdev field, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 04/51] virtio-pci: remove vdev field, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 07/51] virtio-serial: switch exit callback to VirtioDeviceClass,
Michael Roth <=
- [Qemu-stable] [PATCH 05/51] virtio-bus: cleanup plug/unplug interface, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 08/51] virtio-net: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 10/51] virtio-balloon: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 09/51] virtio-scsi: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 11/51] virtio-rng: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 13/51] scsi-bus: fix transfer length and direction for VERIFY command, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 12/51] virtio-pci: add device_unplugged callback, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 14/51] scsi-disk: fix VERIFY emulation, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 17/51] qom: Split out object and class caches, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 15/51] intel-hda: fix position buffer, Michael Roth, 2014/02/21