qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 01/22] QemuOpts: fix a bug in QemuOpts when setting


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH 01/22] QemuOpts: fix a bug in QemuOpts when setting an option twice
Date: Mon, 7 Jun 2010 18:51:49 -0500

Right now, if you set a QemuOpts option in a section twice, when you get the
option you'll receive the value that was set the first time.  This is less than
ideal because if you're manipulating options in two places like a global config
followed by the command line, you really want the later to override the former.

This patch fixes this behavior.

Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/qemu-option.c b/qemu-option.c
index acd74f9..e0cb91b 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -628,7 +628,7 @@ int qemu_opt_set(QemuOpts *opts, const char *name, const 
char *value)
     opt = qemu_mallocz(sizeof(*opt));
     opt->name = qemu_strdup(name);
     opt->opts = opts;
-    QTAILQ_INSERT_TAIL(&opts->head, opt, next);
+    QTAILQ_INSERT_HEAD(&opts->head, opt, next);
     if (desc[i].name != NULL) {
         opt->desc = desc+i;
     }
-- 
1.7.0.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]