aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-blk.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2009-05-14 22:35:07 +0100
committerPaul Brook <paul@codesourcery.com>2009-05-14 22:35:07 +0100
commitcf21e106cd9b34a12a533191932a8a08a1f5ebe4 (patch)
treeab36cc019c2ff8908586a7fcb12b869ccb76cc46 /hw/virtio-blk.c
parent9d07d7579bcaf01e05c511c63d091ed2ac310091 (diff)
Virtio-net qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/virtio-blk.c')
-rw-r--r--hw/virtio-blk.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index dad4ef08c2..b80302b689 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -353,16 +353,20 @@ void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs)
VirtIOBlock *s;
int cylinders, heads, secs;
static int virtio_blk_id;
+ PCIDevice *d;
- s = (VirtIOBlock *)virtio_init_pci(bus, "virtio-blk",
+ d = pci_register_device(bus, "virtio-blk", sizeof(VirtIOBlock),
+ -1, NULL, NULL);
+ if (!d)
+ return NULL;
+
+ s = (VirtIOBlock *)virtio_init_pci(d, "virtio-blk",
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_BLOCK,
PCI_VENDOR_ID_REDHAT_QUMRANET,
VIRTIO_ID_BLOCK,
PCI_CLASS_STORAGE_OTHER, 0x00,
- sizeof(struct virtio_blk_config), sizeof(VirtIOBlock));
- if (!s)
- return NULL;
+ sizeof(struct virtio_blk_config));
s->vdev.get_config = virtio_blk_update_config;
s->vdev.get_features = virtio_blk_get_features;