From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXLCa-0004Ol-L8 for qemu-devel@nongnu.org; Mon, 07 Apr 2014 21:51:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXLCV-0006yq-9t for qemu-devel@nongnu.org; Mon, 07 Apr 2014 21:51:52 -0400 Received: from mail-yh0-f51.google.com ([209.85.213.51]:58830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXLCV-0006ym-5x for qemu-devel@nongnu.org; Mon, 07 Apr 2014 21:51:47 -0400 Received: by mail-yh0-f51.google.com with SMTP id f10so266125yha.10 for ; Mon, 07 Apr 2014 18:51:46 -0700 (PDT) Date: Mon, 7 Apr 2014 22:51:57 -0300 From: Leandro Dorileo Message-ID: <20140408015157.GE11200@dorilex-lnv.MultilaserAP> References: <1396518889-21681-1-git-send-email-cyliu@suse.com> <1396518889-21681-6-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-6-git-send-email-cyliu@suse.com> Subject: Re: [Qemu-devel] [PATCH v24 05/31] QemuOpts: move qemu_opt_del 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:23PM +0800, Chunyan Liu wrote: > In later patch, qemu_opt_get_del functions will be added, they will > first get the option value, then call qemu_opt_del to remove the option > from opt list. To prepare for that purpose, move qemu_opt_del ahead first. > > Reviewed-by: Eric Blake > Signed-off-by: Chunyan Liu Reviewed-by: Leandro Dorileo > --- > util/qemu-option.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/util/qemu-option.c b/util/qemu-option.c > index eab5102..25abd65 100644 > --- a/util/qemu-option.c > +++ b/util/qemu-option.c > @@ -567,6 +567,14 @@ static QemuOpt *qemu_opt_find(QemuOpts *opts, const char *name) > return NULL; > } > > +static void qemu_opt_del(QemuOpt *opt) > +{ > + QTAILQ_REMOVE(&opt->opts->head, opt, next); > + g_free(opt->name); > + g_free(opt->str); > + g_free(opt); > +} > + > const char *qemu_opt_get(QemuOpts *opts, const char *name) > { > QemuOpt *opt = qemu_opt_find(opts, name); > @@ -661,14 +669,6 @@ static void qemu_opt_parse(QemuOpt *opt, Error **errp) > } > } > > -static void qemu_opt_del(QemuOpt *opt) > -{ > - QTAILQ_REMOVE(&opt->opts->head, opt, next); > - g_free(opt->name); > - g_free(opt->str); > - g_free(opt); > -} > - > static bool opts_accepts_any(const QemuOpts *opts) > { > return opts->list->desc[0].name == NULL; > -- > 1.7.12.4 > -- Leandro Dorileo