[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH v3 11/12] virtio-rng: switch exit callback to Virti
From: |
Paolo Bonzini |
Subject: |
[Qemu-stable] [PATCH v3 11/12] virtio-rng: switch exit callback to VirtioDeviceClass |
Date: |
Tue, 15 Oct 2013 18:46:49 +0200 |
This ensures hot-unplug is handled properly by the proxy.
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/virtio/virtio-rng.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index 314e393..18cbfac 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -184,16 +184,14 @@ static int virtio_rng_device_init(VirtIODevice *vdev)
return 0;
}
-static int virtio_rng_device_exit(DeviceState *qdev)
+static void virtio_rng_device_exit(VirtIODevice *vdev)
{
- VirtIORNG *vrng = VIRTIO_RNG(qdev);
- VirtIODevice *vdev = VIRTIO_DEVICE(qdev);
+ VirtIORNG *vrng = VIRTIO_RNG(vdev);
timer_del(vrng->rate_limit_timer);
timer_free(vrng->rate_limit_timer);
- unregister_savevm(qdev, "virtio-rng", vrng);
+ unregister_savevm(DEVICE(vdev), "virtio-rng", vrng);
virtio_cleanup(vdev);
- return 0;
}
static Property virtio_rng_properties[] = {
@@ -205,10 +203,10 @@ static void virtio_rng_class_init(ObjectClass *klass,
void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
- dc->exit = virtio_rng_device_exit;
dc->props = virtio_rng_properties;
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
vdc->init = virtio_rng_device_init;
+ vdc->exit = virtio_rng_device_exit;
vdc->get_features = get_features;
}
--
1.8.3.1
- [Qemu-stable] [PATCH v3 02/12] virtio-bus: remove vdev field, (continued)
- [Qemu-stable] [PATCH v3 02/12] virtio-bus: remove vdev field, Paolo Bonzini, 2013/10/15
- [Qemu-stable] [PATCH v3 01/12] virtio-ccw: move virtio_ccw_stop_ioeventfd to virtio_ccw_busdev_unplug, Paolo Bonzini, 2013/10/15
- [Qemu-stable] [PATCH v3 03/12] virtio-ccw: remove vdev field, Paolo Bonzini, 2013/10/15
- [Qemu-stable] [PATCH v3 04/12] virtio-pci: remove vdev field, Paolo Bonzini, 2013/10/15
- [Qemu-stable] [PATCH v3 05/12] virtio-bus: cleanup plug/unplug interface, Paolo Bonzini, 2013/10/15
- [Qemu-stable] [PATCH v3 06/12] virtio-blk: switch exit callback to VirtioDeviceClass, Paolo Bonzini, 2013/10/15
- [Qemu-stable] [PATCH v3 07/12] virtio-serial: switch exit callback to VirtioDeviceClass, Paolo Bonzini, 2013/10/15
- [Qemu-stable] [PATCH v3 08/12] virtio-net: switch exit callback to VirtioDeviceClass, Paolo Bonzini, 2013/10/15
- [Qemu-stable] [PATCH v3 09/12] virtio-scsi: switch exit callback to VirtioDeviceClass, Paolo Bonzini, 2013/10/15
- [Qemu-stable] [PATCH v3 10/12] virtio-balloon: switch exit callback to VirtioDeviceClass, Paolo Bonzini, 2013/10/15
- [Qemu-stable] [PATCH v3 11/12] virtio-rng: switch exit callback to VirtioDeviceClass,
Paolo Bonzini <=
- [Qemu-stable] [PATCH v3 12/12] virtio-pci: add device_unplugged callback, Paolo Bonzini, 2013/10/15