From 25fe3654834e97b04a2eca1cfa84115d0f281413 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Tue, 29 Sep 2009 15:51:04 +0530 Subject: virtio-pci: return error if virtio_console_init fails Currently only one virtio_console device is supported. Trying to add multiple devices fails and such failure should be reported back to the qdev init functions. Signed-off-by: Amit Shah Signed-off-by: Anthony Liguori --- hw/virtio-pci.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hw/virtio-pci.c') diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 5c97629..01782e5 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -473,6 +473,9 @@ static int virtio_console_init_pci(PCIDevice *pci_dev) proxy->class_code = PCI_CLASS_COMMUNICATION_OTHER; vdev = virtio_console_init(&pci_dev->qdev); + if (!vdev) { + return -1; + } virtio_init_pci(proxy, vdev, PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_CONSOLE, -- cgit v1.1