From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVOUA-000499-HA for qemu-devel@nongnu.org; Fri, 18 May 2012 10:48:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVOU5-0004vs-Rf for qemu-devel@nongnu.org; Fri, 18 May 2012 10:48:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVOU5-0004vo-Iz for qemu-devel@nongnu.org; Fri, 18 May 2012 10:48:49 -0400 Date: Fri, 18 May 2012 11:49:02 -0300 From: Luiz Capitulino Message-ID: <20120518114902.6b8298f8@doriath.home> In-Reply-To: <4FB656B2.2060803@redhat.com> References: <1337265221-7136-1-git-send-email-lcapitulino@redhat.com> <1337265221-7136-5-git-send-email-lcapitulino@redhat.com> <4FB656B2.2060803@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 04/16] qemu-option: parse_option_size(): use error_set() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com, mdroth@linux.vnet.ibm.com On Fri, 18 May 2012 16:03:30 +0200 Laszlo Ersek wrote: > On 05/17/12 16:33, Luiz Capitulino wrote: > > > @@ -291,8 +290,10 @@ int set_option_parameter(QEMUOptionParameter *list, const char *name, > > break; > > > > case OPT_SIZE: > > - if (parse_option_size(name, value, &list->value.n) == -1) > > - return -1; > > + parse_option_size(name, value, &list->value.n, &local_err); > > + if (error_is_set(&local_err)) { > > + goto exit_err; > > + } > > break; > > > > default: > > @@ -602,7 +603,8 @@ static int qemu_opt_parse(QemuOpt *opt) > > &local_err); > > break; > > case QEMU_OPT_SIZE: > > - return parse_option_size(opt->name, opt->str, &opt->value.uint); > > + parse_option_size(opt->name, opt->str, &opt->value.uint, &local_err); > > + break; > > default: > > abort(); > > } > > ... and then the set_option_parameter() change would look like the > qemu_opt_parse() change (no if or goto). But it's fine. I'll simplify if I respin.