|
|
9ae3a8 |
From faea056361cd9955f41a8d8c907af32625885b0d Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 23 Jan 2014 14:03:35 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 08/14] virtio-serial: switch exit callback to VirtioDeviceClass
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1390485820-7585-6-git-send-email-armbru@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 56932
|
|
|
9ae3a8 |
O-Subject: [PATCH 7.0 qemu-kvm 05/10] virtio-serial: switch exit callback to VirtioDeviceClass
|
|
|
9ae3a8 |
Bugzilla: 983344
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
This ensures hot-unplug is handled properly by the proxy, and avoids
|
|
|
9ae3a8 |
leaking bus_name which is freed by virtio_device_exit.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Cc: qemu-stable@nongnu.org
|
|
|
9ae3a8 |
Acked-by: Andreas Faerber <afaerber@suse.de>
|
|
|
9ae3a8 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 0e86c13fe2058adb8c792ebb7c51a6a7ca9d3d55)
|
|
|
9ae3a8 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/char/virtio-serial-bus.c | 10 ++++------
|
|
|
9ae3a8 |
1 file changed, 4 insertions(+), 6 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/char/virtio-serial-bus.c | 10 ++++------
|
|
|
9ae3a8 |
1 files changed, 4 insertions(+), 6 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
|
|
|
9ae3a8 |
index da417c7..57dd070 100644
|
|
|
9ae3a8 |
--- a/hw/char/virtio-serial-bus.c
|
|
|
9ae3a8 |
+++ b/hw/char/virtio-serial-bus.c
|
|
|
9ae3a8 |
@@ -987,12 +987,11 @@ static const TypeInfo virtio_serial_port_type_info = {
|
|
|
9ae3a8 |
.class_init = virtio_serial_port_class_init,
|
|
|
9ae3a8 |
};
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-static int virtio_serial_device_exit(DeviceState *dev)
|
|
|
9ae3a8 |
+static void virtio_serial_device_exit(VirtIODevice *vdev)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- VirtIOSerial *vser = VIRTIO_SERIAL(dev);
|
|
|
9ae3a8 |
- VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
|
|
9ae3a8 |
+ VirtIOSerial *vser = VIRTIO_SERIAL(vdev);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- unregister_savevm(dev, "virtio-console", vser);
|
|
|
9ae3a8 |
+ unregister_savevm(DEVICE(vdev), "virtio-console", vser);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
g_free(vser->ivqs);
|
|
|
9ae3a8 |
g_free(vser->ovqs);
|
|
|
9ae3a8 |
@@ -1004,7 +1003,6 @@ static int virtio_serial_device_exit(DeviceState *dev)
|
|
|
9ae3a8 |
g_free(vser->post_load);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
virtio_cleanup(vdev);
|
|
|
9ae3a8 |
- return 0;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
static Property virtio_serial_properties[] = {
|
|
|
9ae3a8 |
@@ -1016,10 +1014,10 @@ static void virtio_serial_class_init(ObjectClass *klass, void *data)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
DeviceClass *dc = DEVICE_CLASS(klass);
|
|
|
9ae3a8 |
VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
|
|
|
9ae3a8 |
- dc->exit = virtio_serial_device_exit;
|
|
|
9ae3a8 |
dc->props = virtio_serial_properties;
|
|
|
9ae3a8 |
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
|
|
|
9ae3a8 |
vdc->init = virtio_serial_device_init;
|
|
|
9ae3a8 |
+ vdc->exit = virtio_serial_device_exit;
|
|
|
9ae3a8 |
vdc->get_features = get_features;
|
|
|
9ae3a8 |
vdc->get_config = get_config;
|
|
|
9ae3a8 |
vdc->set_config = set_config;
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|