From fc345512c59da62eb2dde3f0a51137a2f848c589 Mon Sep 17 00:00:00 2001 From: Chunyan Liu Date: Thu, 5 Jun 2014 17:20:45 +0800 Subject: QemuOpts: move qemu_opt_del ahead for later calling 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(-) (limited to 'util/qemu-option.c') diff --git a/util/qemu-option.c b/util/qemu-option.c index d4fd7b5f35..71244836c3 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; -- cgit v1.2.3