[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/51] virtio-blk: switch exit callback to VirtioDev
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 06/51] virtio-blk: switch exit callback to VirtioDeviceClass |
Date: |
Fri, 21 Feb 2014 02:16:42 -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 40dfc16f5fe0afb66f9436718781264dfadb6c61)
Signed-off-by: Michael Roth <address@hidden>
---
hw/block/virtio-blk.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 13f6d82..7f0440f 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -728,20 +728,18 @@ static int virtio_blk_device_init(VirtIODevice *vdev)
return 0;
}
-static int virtio_blk_device_exit(DeviceState *dev)
+static void virtio_blk_device_exit(VirtIODevice *vdev)
{
- VirtIODevice *vdev = VIRTIO_DEVICE(dev);
- VirtIOBlock *s = VIRTIO_BLK(dev);
+ VirtIOBlock *s = VIRTIO_BLK(vdev);
#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE
remove_migration_state_change_notifier(&s->migration_state_notifier);
virtio_blk_data_plane_destroy(s->dataplane);
s->dataplane = NULL;
#endif
qemu_del_vm_change_state_handler(s->change);
- unregister_savevm(dev, "virtio-blk", s);
+ unregister_savevm(DEVICE(vdev), "virtio-blk", s);
blockdev_mark_auto_del(s->bs);
virtio_cleanup(vdev);
- return 0;
}
static Property virtio_blk_properties[] = {
@@ -753,10 +751,10 @@ static void virtio_blk_class_init(ObjectClass *klass,
void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
- dc->exit = virtio_blk_device_exit;
dc->props = virtio_blk_properties;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
vdc->init = virtio_blk_device_init;
+ vdc->exit = virtio_blk_device_exit;
vdc->get_config = virtio_blk_update_config;
vdc->set_config = virtio_blk_set_config;
vdc->get_features = virtio_blk_get_features;
--
1.7.9.5
- [Qemu-devel] [PATCH 13/51] scsi-bus: fix transfer length and direction for VERIFY command, (continued)
- [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
- [Qemu-devel] [PATCH 20/51] x86: only allow real mode to access 32bit without LMA, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 21/51] qdev-monitor: Avoid device_add crashing on non-device driver name, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 22/51] split definitions for exec.c and translate-all.c radix trees, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 06/51] virtio-blk: switch exit callback to VirtioDeviceClass,
Michael Roth <=
- [Qemu-devel] [PATCH 24/51] exec: pass hw address to phys_page_find, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 23/51] exec: replace leaf with skip, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 25/51] exec: separate sections and nodes per address space, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 26/51] pc: map PCI address space as catchall region for not mapped addresses, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 28/51] target-mips: fix 64-bit FPU config for user-mode emulation, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 29/51] linux-user: pass correct parameter to do_shmctl(), Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 30/51] linux-user: create target_structs header to place ipc_perm and shmid_ds, Michael Roth, 2014/02/21
- [Qemu-devel] [PATCH 27/51] piix: fix 32bit pci hole, Michael Roth, 2014/02/21