aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-balloon.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-balloon.c
parent9d07d7579bcaf01e05c511c63d091ed2ac310091 (diff)
Virtio-net qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/virtio-balloon.c')
-rw-r--r--hw/virtio-balloon.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c
index 079f49890d..b8f9184e11 100644
--- a/hw/virtio-balloon.c
+++ b/hw/virtio-balloon.c
@@ -172,16 +172,20 @@ static int virtio_balloon_load(QEMUFile *f, void *opaque, int version_id)
void *virtio_balloon_init(PCIBus *bus)
{
VirtIOBalloon *s;
+ PCIDevice *d;
- s = (VirtIOBalloon *)virtio_init_pci(bus, "virtio-balloon",
+ d = pci_register_device(bus, "virtio-balloon", sizeof(VirtIOBalloon),
+ -1, NULL, NULL);
+ if (!d)
+ return NULL;
+
+ s = (VirtIOBalloon *)virtio_init_pci(d, "virtio-balloon",
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_BALLOON,
PCI_VENDOR_ID_REDHAT_QUMRANET,
VIRTIO_ID_BALLOON,
PCI_CLASS_MEMORY_RAM, 0x00,
- 8, sizeof(VirtIOBalloon));
- if (s == NULL)
- return NULL;
+ 8);
s->vdev.get_config = virtio_balloon_get_config;
s->vdev.set_config = virtio_balloon_set_config;