From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO6bE-0007kV-Jt for qemu-devel@nongnu.org; Wed, 18 Feb 2015 10:31:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YO6bA-0004xO-IS for qemu-devel@nongnu.org; Wed, 18 Feb 2015 10:31:40 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:40046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO6bA-0004pv-AG for qemu-devel@nongnu.org; Wed, 18 Feb 2015 10:31:36 -0500 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Feb 2015 15:31:32 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 59F711B0804B for ; Wed, 18 Feb 2015 15:31:43 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1IFVU5a16580808 for ; Wed, 18 Feb 2015 15:31:30 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1IFVU4F023618 for ; Wed, 18 Feb 2015 08:31:30 -0700 Date: Wed, 18 Feb 2015 16:31:28 +0100 From: Cornelia Huck Message-ID: <20150218163128.3913917c.cornelia.huck@de.ibm.com> In-Reply-To: <878ufvz3bm.fsf@blackfin.pond.sub.org> References: <1423128889-18260-1-git-send-email-armbru@redhat.com> <1423128889-18260-4-git-send-email-armbru@redhat.com> <878ufvz3bm.fsf@blackfin.pond.sub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] s390x: Replace unchecked qdev_init() by qdev_init_nofail() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Christian Borntraeger , Alexander Graf , qemu-devel@nongnu.org, afaerber@suse.de On Wed, 18 Feb 2015 15:45:01 +0100 Markus Armbruster wrote: > Connie, your commit 7b35d0c suggests you're highly qualified to review. > No good deed shall go unpunished ;) Yeah, it has been on my todo list... > > Markus Armbruster writes: > > > 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. Yes, this _is_ odd. I'd say we'd want to die if we can't instatiate the kvm-flic, but at least for injecting interrupts we have a fallback to the old method (but looking at the code, this does not quite work out as I thought it would). The qemu-flic is really just a dummy. > > > > 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 > > Cc: Cornelia Huck > > Cc: Alexander Graf > > Signed-off-by: Markus Armbruster > > --- > > 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, I think this is OK for the time being. We need to look into the various weirdnesses for the kvm-flic, though. Acked-by: Cornelia Huck