From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqfUn-0007uI-Gq for qemu-devel@nongnu.org; Wed, 23 Sep 2009 23:59:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqfUf-0007qt-Ck for qemu-devel@nongnu.org; Wed, 23 Sep 2009 23:59:52 -0400 Received: from [199.232.76.173] (port=34559 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqfUf-0007qq-7K for qemu-devel@nongnu.org; Wed, 23 Sep 2009 23:59:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39724) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqfUd-0004Np-Ex for qemu-devel@nongnu.org; Wed, 23 Sep 2009 23:59:44 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8O3xcAq002508 for ; Wed, 23 Sep 2009 23:59:38 -0400 Date: Thu, 24 Sep 2009 09:29:08 +0530 From: Amit Shah Subject: Re: [Qemu-devel] [PATCH] qdev: show failing device name instead of silently exiting Message-ID: <20090924035908.GA4584@amit-x200.redhat.com> References: <1253704471-30740-1-git-send-email-amit.shah@redhat.com> <8763b97588.fsf@pike.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8763b97588.fsf@pike.pond.sub.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org Hey Markus, On (Wed) Sep 23 2009 [22:53:27], Markus Armbruster wrote: > Amit Shah writes: > > > If initializing a device fails, show the name of the device > > and then exit > > "and then exit" is misleading, as you don't add an exit. The 'return NULL' does that -- the calling function exits. (doesn't the subject line clarify that?) > > Signed-off-by: Amit Shah > > --- > > hw/qdev.c | 1 + > > 1 files changed, 1 insertions(+), 0 deletions(-) > > > > diff --git a/hw/qdev.c b/hw/qdev.c > > index 1d79db0..62a6fc7 100644 > > --- a/hw/qdev.c > > +++ b/hw/qdev.c > > @@ -203,6 +203,7 @@ DeviceState *qdev_device_add(QemuOpts *opts) > > return NULL; > > } > > if (qdev_init(qdev) != 0) { > > + qemu_error("Error initializing device %s\n", driver); > > qdev_free(qdev); > > return NULL; > > } Amit