qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: qemu-devel@nongnu.org
Cc: Amit Shah <amit.shah@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] virtio-pci: return error if virtio_console_init fails
Date: Tue, 29 Sep 2009 15:51:04 +0530	[thread overview]
Message-ID: <1254219664-7437-2-git-send-email-amit.shah@redhat.com> (raw)
In-Reply-To: <1254219664-7437-1-git-send-email-amit.shah@redhat.com>

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>
---
 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

      reply	other threads:[~2009-09-29 10:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-29 10:21 [Qemu-devel] [PATCH 1/2] qdev: show name of device that fails init Amit Shah
2009-09-29 10:21 ` Amit Shah [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1254219664-7437-2-git-send-email-amit.shah@redhat.com \
    --to=amit.shah@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).