[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/51] virtio-balloon: switch exit callback to Virti
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 10/51] virtio-balloon: switch exit callback to VirtioDeviceClass |
Date: |
Fri, 21 Feb 2014 02:16:46 -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 baa61b9870dd7e0bb07e0ae61c6ec805db13f699)
Signed-off-by: Michael Roth <address@hidden>
---
hw/virtio/virtio-balloon.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 9504877..d7a392d 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -370,16 +370,14 @@ static int virtio_balloon_device_init(VirtIODevice *vdev)
return 0;
}
-static int virtio_balloon_device_exit(DeviceState *qdev)
+static void virtio_balloon_device_exit(VirtIODevice *vdev)
{
- VirtIOBalloon *s = VIRTIO_BALLOON(qdev);
- VirtIODevice *vdev = VIRTIO_DEVICE(qdev);
+ VirtIOBalloon *s = VIRTIO_BALLOON(vdev);
balloon_stats_destroy_timer(s);
qemu_remove_balloon_handler(s);
- unregister_savevm(qdev, "virtio-balloon", s);
+ unregister_savevm(DEVICE(vdev), "virtio-balloon", s);
virtio_cleanup(vdev);
- return 0;
}
static Property virtio_balloon_properties[] = {
@@ -390,10 +388,10 @@ static void virtio_balloon_class_init(ObjectClass *klass,
void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
- dc->exit = virtio_balloon_device_exit;
dc->props = virtio_balloon_properties;
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
vdc->init = virtio_balloon_device_init;
+ vdc->exit = virtio_balloon_device_exit;
vdc->get_config = virtio_balloon_get_config;
vdc->set_config = virtio_balloon_set_config;
vdc->get_features = virtio_balloon_get_features;
--
1.7.9.5
- [Qemu-devel] Patch Round-up for stable 1.7.1, freeze on 2013-02-27, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 01/51] virtio-ccw: move virtio_ccw_stop_ioeventfd to virtio_ccw_busdev_unplug, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 02/51] virtio-bus: remove vdev field, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 03/51] virtio-ccw: remove vdev field, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 04/51] virtio-pci: remove vdev field, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 05/51] virtio-bus: cleanup plug/unplug interface, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 07/51] virtio-serial: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 08/51] virtio-net: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 10/51] virtio-balloon: switch exit callback to VirtioDeviceClass,
Michael Roth <=
- [Qemu-devel] [PATCH 11/51] virtio-rng: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 09/51] virtio-scsi: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 12/51] virtio-pci: add device_unplugged callback, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 13/51] scsi-bus: fix transfer length and direction for VERIFY command, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 14/51] scsi-disk: fix VERIFY emulation, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 17/51] qom: Split out object and class caches, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 16/51] memory.c: bugfix - ref counting mismatch in memory_region_find, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 15/51] intel-hda: fix position buffer, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 19/51] vl: add missing transition debug->finish_migrate, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 18/51] migration: Fix rate limit, Michael Roth, 2014/02/21