aboutsummaryrefslogtreecommitdiff
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
parentPCI network qdev conversion (diff)
downloadqemu-kvm-cf21e106cd9b34a12a533191932a8a08a1f5ebe4.tar.gz
qemu-kvm-cf21e106cd9b34a12a533191932a8a08a1f5ebe4.tar.bz2
qemu-kvm-cf21e106cd9b34a12a533191932a8a08a1f5ebe4.zip
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 dad4ef08c..b80302b68 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;