From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39380 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWA9Z-0006MT-OM for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:33:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWA9Y-00008n-Az for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:33:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58714) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWA9Y-00008Q-2v for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:33:44 -0400 From: Kevin Wolf Date: Tue, 6 Jul 2010 17:33:17 +0200 Message-Id: <1278430406-18667-9-git-send-email-kwolf@redhat.com> In-Reply-To: <1278430406-18667-1-git-send-email-kwolf@redhat.com> References: <1278430406-18667-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 08/17] qdev: Don't hw_error() in qdev_init_nofail() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Markus Armbruster Some of the failures are internal errors, and hw_error() is okay then. But the common way to fail is bad user input, e.g. -global isa-fdc.driveA=foo where drive foo has an unsupported rerror value. exit(1) instead. Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- hw/qdev.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index 61f999c..00ceada 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -326,8 +326,10 @@ void qdev_init_nofail(DeviceState *dev) { DeviceInfo *info = dev->info; - if (qdev_init(dev) < 0) - hw_error("Initialization of device %s failed\n", info->name); + if (qdev_init(dev) < 0) { + error_report("Initialization of device %s failed\n", info->name); + exit(1); + } } /* Unlink device from bus and free the structure. */ -- 1.6.6.1