From patchwork Tue Sep 29 10:21:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 34417 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D0F71B7BCD for ; Tue, 29 Sep 2009 20:25:06 +1000 (EST) Received: from localhost ([127.0.0.1]:58581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsZtI-0003Co-4e for incoming@patchwork.ozlabs.org; Tue, 29 Sep 2009 06:25:04 -0400 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 Received: from localhost (vpn-225-25.phx2.redhat.com [10.3.225.25]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8TALejV023022; Tue, 29 Sep 2009 06:21:41 -0400 From: Amit Shah To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Amit Shah Subject: [Qemu-devel] [PATCH 2/2] virtio-pci: return error if virtio_console_init fails X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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,