Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NAmHP-0000pQ-L7 for qemu-devel@nongnu.org; Wed, 18 Nov 2009 10:17:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NAmHK-0000n0-U5 for qemu-devel@nongnu.org; Wed, 18 Nov 2009 10:17:11 -0500 Received: from [199.232.76.173] (port=56653 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAmHK-0000mv-Qm for qemu-devel@nongnu.org; Wed, 18 Nov 2009 10:17:06 -0500 Received: from mx20.gnu.org ([199.232.41.8]:29837) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NAmHK-00066v-Eu for qemu-devel@nongnu.org; Wed, 18 Nov 2009 10:17:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NAmHJ-0007p6-Ml for qemu-devel@nongnu.org; Wed, 18 Nov 2009 10:17:05 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 09/10] qdev: Use QError for 'device not found' error References: <1258487037-24950-1-git-send-email-lcapitulino@redhat.com> <1258487037-24950-10-git-send-email-lcapitulino@redhat.com> Date: Wed, 18 Nov 2009 16:17:02 +0100 In-Reply-To: <1258487037-24950-10-git-send-email-lcapitulino@redhat.com> (Luiz Capitulino's message of "Tue, 17 Nov 2009 17:43:56 -0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, kraxel@redhat.com Luiz Capitulino writes: > Signed-off-by: Luiz Capitulino > --- > hw/qdev.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/qdev.c b/hw/qdev.c > index d19d531..875ca50 100644 > --- a/hw/qdev.c > +++ b/hw/qdev.c > @@ -29,6 +29,7 @@ > #include "qdev.h" > #include "sysemu.h" > #include "monitor.h" > +#include "qerror.h" > > static int qdev_hotplug = 0; > > @@ -176,8 +177,7 @@ DeviceState *qdev_device_add(QemuOpts *opts) > /* find driver */ > info = qdev_find_info(NULL, driver); > if (!info) { > - qemu_error("Device \"%s\" not found. Try -device '?' for a list.\n", > - driver); > + qemu_error_new(QERR_DEVICE_NOT_FOUND, driver); > return NULL; > } > if (info->no_user) { Not obvious from this patch, but we lose the "Try -device '?' for a list" hint here. In PATCH 7/10: +#define QERR_DEVICE_NOT_FOUND \ + "{ 'class': 'DeviceNotFound', 'data': { 'name': %s } }" + and + { + .error_fmt = QERR_DEVICE_NOT_FOUND, + .desc = "device \"%(name)\" not found", + }, Not a deal-breaker for me.