From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwV2q-0003In-0c for qemu-devel@nongnu.org; Mon, 16 Jun 2014 07:25:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwV2k-0001lW-TO for qemu-devel@nongnu.org; Mon, 16 Jun 2014 07:25:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwV2k-0001kt-LK for qemu-devel@nongnu.org; Mon, 16 Jun 2014 07:25:42 -0400 From: Stefan Hajnoczi Date: Mon, 16 Jun 2014 19:23:36 +0800 Message-Id: <1402917843-6459-13-git-send-email-stefanha@redhat.com> In-Reply-To: <1402917843-6459-1-git-send-email-stefanha@redhat.com> References: <1402917843-6459-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 12/39] QemuOpts: move qemu_opt_del ahead for later calling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Chunyan Liu , Stefan Hajnoczi From: Chunyan Liu 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 Reviewed-by: Leandro Dorileo Signed-off-by: Chunyan Liu Signed-off-by: Stefan Hajnoczi --- 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 d4fd7b5..7124483 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.9.3