From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MsZq7-0002pG-Ty for qemu-devel@nongnu.org; Tue, 29 Sep 2009 06:21:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MsZq3-0002oB-2t for qemu-devel@nongnu.org; Tue, 29 Sep 2009 06:21:47 -0400 Received: from [199.232.76.173] (port=38622 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsZq2-0002o3-TD for qemu-devel@nongnu.org; Tue, 29 Sep 2009 06:21:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29873) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MsZq2-0004az-Hw for qemu-devel@nongnu.org; Tue, 29 Sep 2009 06:21:42 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8TALfOL029570 for ; Tue, 29 Sep 2009 06:21:41 -0400 From: Amit Shah Date: Tue, 29 Sep 2009 15:51:04 +0530 Message-Id: <1254219664-7437-2-git-send-email-amit.shah@redhat.com> In-Reply-To: <1254219664-7437-1-git-send-email-amit.shah@redhat.com> References: <1254219664-7437-1-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] virtio-pci: return error if virtio_console_init fails List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Amit Shah 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 --- hw/virtio-pci.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index bd5a7c4..66967c6 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -470,6 +470,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, -- 1.6.2.5