aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-console.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-console.c
parent9d07d7579bcaf01e05c511c63d091ed2ac310091 (diff)
Virtio-net qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/virtio-console.c')
-rw-r--r--hw/virtio-console.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index b263281d8f..c006d90a95 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -126,14 +126,20 @@ static int virtio_console_load(QEMUFile *f, void *opaque, int version_id)
void *virtio_console_init(PCIBus *bus, CharDriverState *chr)
{
VirtIOConsole *s;
+ PCIDevice *d;
- s = (VirtIOConsole *)virtio_init_pci(bus, "virtio-console",
+ d = pci_register_device(bus, "virtio-console", sizeof(VirtIOConsole),
+ -1, NULL, NULL);
+ if (!d)
+ return NULL;
+
+ s = (VirtIOConsole *)virtio_init_pci(d, "virtio-console",
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_CONSOLE,
PCI_VENDOR_ID_REDHAT_QUMRANET,
VIRTIO_ID_CONSOLE,
PCI_CLASS_DISPLAY_OTHER, 0x00,
- 0, sizeof(VirtIOConsole));
+ 0);
if (s == NULL)
return NULL;