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 <aligu...@us.ibm.com> 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