From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43857 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLm7A-0004KF-T0 for qemu-devel@nongnu.org; Mon, 07 Jun 2010 19:52:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLm78-00038V-Lz for qemu-devel@nongnu.org; Mon, 07 Jun 2010 19:52:20 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:37340) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLm78-00037x-Es for qemu-devel@nongnu.org; Mon, 07 Jun 2010 19:52:18 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by e4.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o57Nd8qB009663 for ; Mon, 7 Jun 2010 19:39:08 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o57NqFOP1388760 for ; Mon, 7 Jun 2010 19:52:15 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o57NqEhu010017 for ; Mon, 7 Jun 2010 20:52:14 -0300 From: Anthony Liguori Date: Mon, 7 Jun 2010 18:51:49 -0500 Message-Id: <1275954730-8196-2-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1275954730-8196-1-git-send-email-aliguori@us.ibm.com> References: <1275954730-8196-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 01/22] QemuOpts: fix a bug in QemuOpts when setting an option twice List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Glauber Costa , Anthony Liguori , Gerd Hoffman 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 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