From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXKfX-0000hV-G2 for qemu-devel@nongnu.org; Mon, 07 Apr 2014 21:17:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXKfR-0005GC-Tn for qemu-devel@nongnu.org; Mon, 07 Apr 2014 21:17:43 -0400 Received: from mail-yk0-f177.google.com ([209.85.160.177]:35552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXKfR-0005G6-PC for qemu-devel@nongnu.org; Mon, 07 Apr 2014 21:17:37 -0400 Received: by mail-yk0-f177.google.com with SMTP id q200so222562ykb.36 for ; Mon, 07 Apr 2014 18:17:37 -0700 (PDT) Date: Mon, 7 Apr 2014 22:17:48 -0300 From: Leandro Dorileo Message-ID: <20140408011748.GB1431@dorilex-lnv.MultilaserAP> References: <1396518889-21681-1-git-send-email-cyliu@suse.com> <1396518889-21681-2-git-send-email-cyliu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1396518889-21681-2-git-send-email-cyliu@suse.com> Subject: Re: [Qemu-devel] [PATCH v24 01/31] 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 Thu, Apr 03, 2014 at 05:54:19PM +0800, Chunyan Liu wrote: > 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 9d898af..e6d10bc 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.7.12.4 > -- Leandro Dorileo