From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfwKr-00041z-4x for qemu-devel@nongnu.org; Thu, 01 May 2014 15:08:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfwKl-0001o7-Qd for qemu-devel@nongnu.org; Thu, 01 May 2014 15:07:57 -0400 Received: from mail-yh0-f42.google.com ([209.85.213.42]:65079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfwKl-0001nt-MB for qemu-devel@nongnu.org; Thu, 01 May 2014 15:07:51 -0400 Received: by mail-yh0-f42.google.com with SMTP id f73so3340543yha.29 for ; Thu, 01 May 2014 12:07:50 -0700 (PDT) Date: Thu, 1 May 2014 16:07:49 -0300 From: Leandro Dorileo Message-ID: <20140501190749.GA29944@dorilex-lnv.MultilaserAP> References: <1398762521-25733-1-git-send-email-cyliu@suse.com> <1398762521-25733-2-git-send-email-cyliu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1398762521-25733-2-git-send-email-cyliu@suse.com> Subject: Re: [Qemu-devel] [PATCH V26 01/32] QemuOpts: move find_desc_by_name ahead for later calling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu Cc: qemu-devel@nongnu.org, stefanha@redhat.com On Tue, Apr 29, 2014 at 05:08:10PM +0800, Chunyan Liu wrote: > Reviewed-by: Stefan Hajnoczi > Reviewed-by: Eric Blake > Signed-off-by: Chunyan Liu Reviewed-by: Leandro Dorileo > --- > util/qemu-option.c | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > > diff --git a/util/qemu-option.c b/util/qemu-option.c > index 8bbc3ad..808aef4 100644 > --- a/util/qemu-option.c > +++ b/util/qemu-option.c > @@ -173,6 +173,20 @@ static void parse_option_number(const char *name, const char *value, > } > } > > +static const QemuOptDesc *find_desc_by_name(const QemuOptDesc *desc, > + const char *name) > +{ > + int i; > + > + for (i = 0; desc[i].name != NULL; i++) { > + if (strcmp(desc[i].name, name) == 0) { > + return &desc[i]; > + } > + } > + > + return NULL; > +} > + > void parse_option_size(const char *name, const char *value, > uint64_t *ret, Error **errp) > { > @@ -637,20 +651,6 @@ static bool opts_accepts_any(const QemuOpts *opts) > return opts->list->desc[0].name == NULL; > } > > -static const QemuOptDesc *find_desc_by_name(const QemuOptDesc *desc, > - const char *name) > -{ > - int i; > - > - for (i = 0; desc[i].name != NULL; i++) { > - if (strcmp(desc[i].name, name) == 0) { > - return &desc[i]; > - } > - } > - > - return NULL; > -} > - > int qemu_opt_unset(QemuOpts *opts, const char *name) > { > QemuOpt *opt = qemu_opt_find(opts, name); > -- > 1.8.4.5 > > -- Leandro Dorileo