summaryrefslogtreecommitdiff
path: root/hw/virtio-pci.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-09-25 21:42:46 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:49 -0500
commit56a14938809331372b6cdb2afcb14d9818de4cbf (patch)
tree256e324375f698356af28158f601b2301a673ba5 /hw/virtio-pci.c
parent3f84865ade594a2ec1ef613ab5fd11949f3d49de (diff)
drive cleanup fixes.
Changes: * drive_uninit() wants a DriveInfo now. * drive_uninit() also calls bdrv_delete(), so callers don't need to do that. * drive_uninit() calls are moved over to the ->exit() callbacks, destroy_bdrvs() is zapped. * setting bdrv->private is not needed any more as the only user (destroy_bdrvs) is gone. * usb-storage needs no drive_uninit, scsi-disk will handle that. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r--hw/virtio-pci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index c6fbaacb25..7b86bfc9ef 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -458,6 +458,14 @@ static int virtio_blk_init_pci(PCIDevice *pci_dev)
return 0;
}
+static int virtio_blk_exit_pci(PCIDevice *pci_dev)
+{
+ VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
+
+ drive_uninit(proxy->dinfo);
+ return 0;
+}
+
static int virtio_console_init_pci(PCIDevice *pci_dev)
{
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
@@ -519,6 +527,7 @@ static PCIDeviceInfo virtio_info[] = {
.qdev.name = "virtio-blk-pci",
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_blk_init_pci,
+ .exit = virtio_blk_exit_pci,
.qdev.props = (Property[]) {
DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
DEFINE_PROP_DRIVE("drive", VirtIOPCIProxy, dinfo),