diff options
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r-- | hw/virtio-pci.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 6052c1671c..d605b5fb1f 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -449,7 +449,8 @@ static void virtio_blk_init_pci_0_10(PCIDevice *pci_dev) virtio_blk_init_pci_with_class(pci_dev, PCI_CLASS_STORAGE_OTHER); } -static void virtio_console_init_pci(PCIDevice *pci_dev) +static void virtio_console_init_pci_with_class(PCIDevice *pci_dev, + uint16_t class_code) { VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); VirtIODevice *vdev; @@ -458,8 +459,17 @@ static void virtio_console_init_pci(PCIDevice *pci_dev) virtio_init_pci(proxy, vdev, PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_CONSOLE, - PCI_CLASS_DISPLAY_OTHER, - 0x00); + class_code, 0x00); +} + +static void virtio_console_init_pci(PCIDevice *pci_dev) +{ + virtio_console_init_pci_with_class(pci_dev, PCI_CLASS_SERIAL_OTHER); +} + +static void virtio_console_init_pci_0_10(PCIDevice *pci_dev) +{ + virtio_console_init_pci_with_class(pci_dev, PCI_CLASS_DISPLAY_OTHER); } static void virtio_net_init_pci(PCIDevice *pci_dev) @@ -511,6 +521,10 @@ static PCIDeviceInfo virtio_info[] = { .qdev.size = sizeof(VirtIOPCIProxy), .init = virtio_blk_init_pci_0_10, },{ + .qdev.name = "virtio-console-pci-0-10", + .qdev.size = sizeof(VirtIOPCIProxy), + .init = virtio_console_init_pci_0_10, + },{ /* end of list */ } }; |