diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-06-30 14:12:07 +0200 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2009-07-09 13:07:02 +0100 |
commit | 0aab0d3a4a62505ab7e79ee0a67fe3f04f6dae23 (patch) | |
tree | 59539fa84519cc5cc7aa24c4c7cb0435edfbdfbb /hw/virtio-pci.c | |
parent | e2b19c85ea0f3fd6091386adfd3a2acd21107cb4 (diff) |
qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunch
of parameters. Also adds config_read and config_write callbacks to
PCIDeviceInfo, so drivers needing these can be converted to the qdev
device API too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r-- | hw/virtio-pci.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index f7da503752..39e290dc62 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -466,16 +466,31 @@ static void virtio_balloon_init_pci(PCIDevice *pci_dev) 0x00); } +static PCIDeviceInfo virtio_info[] = { + { + .qdev.name = "virtio-blk-pci", + .qdev.size = sizeof(VirtIOPCIProxy), + .init = virtio_blk_init_pci, + },{ + .qdev.name = "virtio-net-pci", + .qdev.size = sizeof(VirtIOPCIProxy), + .init = virtio_net_init_pci, + },{ + .qdev.name = "virtio-console-pci", + .qdev.size = sizeof(VirtIOPCIProxy), + .init = virtio_console_init_pci, + },{ + .qdev.name = "virtio-balloon-pci", + .qdev.size = sizeof(VirtIOPCIProxy), + .init = virtio_balloon_init_pci, + },{ + /* end of list */ + } +}; + static void virtio_pci_register_devices(void) { - pci_qdev_register("virtio-blk-pci", sizeof(VirtIOPCIProxy), - virtio_blk_init_pci); - pci_qdev_register("virtio-net-pci", sizeof(VirtIOPCIProxy), - virtio_net_init_pci); - pci_qdev_register("virtio-console-pci", sizeof(VirtIOPCIProxy), - virtio_console_init_pci); - pci_qdev_register("virtio-balloon-pci", sizeof(VirtIOPCIProxy), - virtio_balloon_init_pci); + pci_qdev_register_many(virtio_info); } device_init(virtio_pci_register_devices) |