From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mlo7s-0003jP-3G for qemu-devel@nongnu.org; Thu, 10 Sep 2009 14:12:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mlo7o-0003gF-Ms for qemu-devel@nongnu.org; Thu, 10 Sep 2009 14:12:07 -0400 Received: from [199.232.76.173] (port=56728 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mlo7n-0003gA-3w for qemu-devel@nongnu.org; Thu, 10 Sep 2009 14:12:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61840) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mlo7m-0007bD-DZ for qemu-devel@nongnu.org; Thu, 10 Sep 2009 14:12:02 -0400 From: Mark McLoughlin In-Reply-To: References: <1252595941-15196-1-git-send-email-markmc@redhat.com> <1252595941-15196-5-git-send-email-markmc@redhat.com> Content-Type: text/plain Date: Thu, 10 Sep 2009 19:10:56 +0100 Message-Id: <1252606256.3403.45.camel@blaa> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 04/19] Remove double error message for -device option parsing Reply-To: Mark McLoughlin List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On Thu, 2009-09-10 at 18:25 +0200, Juan Quintela wrote: > Mark McLoughlin wrote: > > qemu_opts_parse() gives a suitable error message in all failure cases > > so we can remove the error message from the caller. > > > > Signed-off-by: Mark McLoughlin > > --- > > vl.c | 5 +---- > > 1 files changed, 1 insertions(+), 4 deletions(-) > > > > diff --git a/vl.c b/vl.c > > index 6da83a6..ed07d50 100644 > > --- a/vl.c > > +++ b/vl.c > > @@ -5251,11 +5251,8 @@ int main(int argc, char **argv, char **envp) > > add_device_config(DEV_USB, optarg); > > break; > > case QEMU_OPTION_device: > > - opts = qemu_opts_parse(&qemu_device_opts, optarg, "driver"); > > - if (!opts) { > > - fprintf(stderr, "parse error: %s\n", optarg); > > + if (!qemu_opts_parse(&qemu_device_opts, optarg, "driver")) > > exit(1); > > - } > > break; > > case QEMU_OPTION_smp: > > smp_parse(optarg); > > This was the only use of opts variable, you have to remove it. I did, but then re-added it when I re-based to Anthony's queue. The chardev stuff uses it. > And you shouldn't remove the braces (read the qemu coding style). Yeah, I try not to, it was a reflex, I guess. (It's also not helped that a lot of the existing code doesn't follow this aspect of the coding style) Cheers, Mark.