From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NAoOi-0007jh-KD for qemu-devel@nongnu.org; Wed, 18 Nov 2009 12:32:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NAoOZ-0007eR-Bg for qemu-devel@nongnu.org; Wed, 18 Nov 2009 12:32:47 -0500 Received: from [199.232.76.173] (port=36271 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAoOZ-0007eJ-15 for qemu-devel@nongnu.org; Wed, 18 Nov 2009 12:32:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53048) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NAoOY-0007J1-8f for qemu-devel@nongnu.org; Wed, 18 Nov 2009 12:32:42 -0500 Date: Wed, 18 Nov 2009 15:32:32 -0200 From: Luiz Capitulino Subject: Re: [Qemu-devel] [PATCH 09/10] qdev: Use QError for 'device not found' error Message-ID: <20091118153232.652340b2@doriath> In-Reply-To: References: <1258487037-24950-1-git-send-email-lcapitulino@redhat.com> <1258487037-24950-10-git-send-email-lcapitulino@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, kraxel@redhat.com On Wed, 18 Nov 2009 16:17:02 +0100 Markus Armbruster wrote: > 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. Yes, this happens because this is a generic error and '-device' is qdev command-line specific.