aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-balloon.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2009-05-18 14:51:59 +0100
committerPaul Brook <paul@codesourcery.com>2009-05-18 18:26:33 +0100
commit53c25cea7d59525ca9aa3fb01cc6947bafbbfb61 (patch)
tree3556ba85599852e60d9570d41b01897d5a61aafc /hw/virtio-balloon.c
parentd8ee7665bfc7846c7fc6bfb96434eca68e5bec1a (diff)
downloadqemu-53c25cea7d59525ca9aa3fb01cc6947bafbbfb61.zip
qemu-53c25cea7d59525ca9aa3fb01cc6947bafbbfb61.tar.gz
qemu-53c25cea7d59525ca9aa3fb01cc6947bafbbfb61.tar.bz2
Separate virtio PCI code
Split the PCI host bindings from the VRing transport implementation. Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/virtio-balloon.c')
-rw-r--r--hw/virtio-balloon.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c
index 7fa7e47..cfd3b41 100644
--- a/hw/virtio-balloon.c
+++ b/hw/virtio-balloon.c
@@ -169,17 +169,13 @@ static int virtio_balloon_load(QEMUFile *f, void *opaque, int version_id)
return 0;
}
-static void virtio_balloon_init(PCIDevice *pci_dev)
+VirtIODevice *virtio_balloon_init(DeviceState *dev)
{
VirtIOBalloon *s;
- s = (VirtIOBalloon *)virtio_init_pci(pci_dev, "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);
+ s = (VirtIOBalloon *)virtio_common_init("virtio-balloon",
+ VIRTIO_ID_BALLOON,
+ 8, sizeof(VirtIOBalloon));
s->vdev.get_config = virtio_balloon_get_config;
s->vdev.set_config = virtio_balloon_set_config;
@@ -191,12 +187,6 @@ static void virtio_balloon_init(PCIDevice *pci_dev)
qemu_add_balloon_handler(virtio_balloon_to_target, s);
register_savevm("virtio-balloon", -1, 1, virtio_balloon_save, virtio_balloon_load, s);
-}
-static void virtio_balloon_register_devices(void)
-{
- pci_qdev_register("virtio-balloon", sizeof(VirtIOBalloon),
- virtio_balloon_init);
+ return &s->vdev;
}
-
-device_init(virtio_balloon_register_devices)