qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: peter.maydell@linaro.org
Cc: agraf@suse.de, qemu-devel@nongnu.org,
	Markus Armbruster <armbru@redhat.com>,
	borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com,
	Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: [Qemu-devel] [PULL for-2.3 01/10] s390x: Replace unchecked qdev_init() by qdev_init_nofail()
Date: Mon, 16 Mar 2015 11:08:09 +0100	[thread overview]
Message-ID: <1426500498-24129-2-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1426500498-24129-1-git-send-email-cornelia.huck@de.ibm.com>

From: Markus Armbruster <armbru@redhat.com>

s390_flic_init() is a helper to create and realize either
"s390-flic-kvm" or "s390-flic-qemu".  When qdev_init() fails, it
complains to stderr and succeeds.

Except it can't actually fail, because the "s390-flic-qemu" is a dummy
without a realize method, and "s390-flic-kvm"'s realize can't fail,
even when the kernel device is really unavailable.  Odd.

Replace qdev_init() by qdev_init_nofail() to make "can't fail" locally
obvious, and get rid of the unreachable error reporting.

Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-Id: <1423128889-18260-4-git-send-email-armbru@redhat.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/intc/s390_flic.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
index 03c5e89..02e10b7 100644
--- a/hw/intc/s390_flic.c
+++ b/hw/intc/s390_flic.c
@@ -30,7 +30,6 @@ S390FLICState *s390_get_flic(void)
 void s390_flic_init(void)
 {
     DeviceState *dev;
-    int r;
 
     dev = s390_flic_kvm_create();
     if (!dev) {
@@ -38,10 +37,7 @@ void s390_flic_init(void)
         object_property_add_child(qdev_get_machine(), TYPE_QEMU_S390_FLIC,
                                   OBJECT(dev), NULL);
     }
-    r = qdev_init(dev);
-    if (r) {
-        error_report("flic: couldn't create qdev");
-    }
+    qdev_init_nofail(dev);
 }
 
 static int qemu_s390_register_io_adapter(S390FLICState *fs, uint32_t id,
-- 
2.3.3

  reply	other threads:[~2015-03-16 10:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 10:08 [Qemu-devel] [PULL for-2.3 00/10] s390x: final updates Cornelia Huck
2015-03-16 10:08 ` Cornelia Huck [this message]
2015-03-16 10:08 ` [Qemu-devel] [PULL for-2.3 02/10] s390x/kvm: Guest Migration TOD clock synchronization Cornelia Huck
2015-03-16 10:08 ` [Qemu-devel] [PULL for-2.3 03/10] virtio-ccw: assure BE accesses Cornelia Huck
2015-03-16 10:08 ` [Qemu-devel] [PULL for-2.3 04/10] kvm: encapsulate HAS_DEVICE for vm attrs Cornelia Huck
2015-03-16 10:08 ` [Qemu-devel] [PULL for-2.3 05/10] s390x/kvm: make use of generic vm attribute check Cornelia Huck
2015-03-16 10:08 ` [Qemu-devel] [PULL for-2.3 06/10] s390x: CPACF: Handle key wrap machine options Cornelia Huck
2015-03-16 10:08 ` [Qemu-devel] [PULL for-2.3 07/10] s390x/virtio-bus: Remove unused function s390_virtio_bus_console() Cornelia Huck
2015-03-16 10:08 ` [Qemu-devel] [PULL for-2.3 08/10] s390x/ipl: remove dead code Cornelia Huck
2015-03-16 10:08 ` [Qemu-devel] [PULL for-2.3 09/10] s390x/pci: fix length in sei_nt2 event Cornelia Huck
2015-03-16 10:08 ` [Qemu-devel] [PULL for-2.3 10/10] s390x/config: Do not include full pci.mak Cornelia Huck
2015-03-16 13:03 ` [Qemu-devel] [PULL for-2.3 00/10] s390x: final updates Peter Maydell

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=1426500498-24129-2-git-send-email-cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --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).