summary refs log tree commit diff stats
path: root/hw/virtio-pci.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2009-09-29 15:51:04 +0530
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:53 -0500
commit25fe3654834e97b04a2eca1cfa84115d0f281413 (patch)
tree82ae354ebc89734b7bb919b81784d25b77349b40 /hw/virtio-pci.c
parentc8cd1fcd668f514a84f5e6d93a8e6f19c082708a (diff)
downloadfocaccia-qemu-25fe3654834e97b04a2eca1cfa84115d0f281413.tar.gz
focaccia-qemu-25fe3654834e97b04a2eca1cfa84115d0f281413.zip
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 <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r--hw/virtio-pci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 5c976296e3..01782e5807 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,