Received: from eggs.gnu.org ([140.186.70.92]:55546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rv0WA-0000z1-FT for qemu-devel@nongnu.org; Wed, 08 Feb 2012 00:56:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rv0W6-0006JP-Cp for qemu-devel@nongnu.org; Wed, 08 Feb 2012 00:56:34 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:33375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rv0W6-0006JH-3W for qemu-devel@nongnu.org; Wed, 08 Feb 2012 00:56:30 -0500 From: Peter Maydell Date: Wed, 8 Feb 2012 05:41:38 +0000 Message-Id: <1328679700-31015-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1328679700-31015-1-git-send-email-peter.maydell@linaro.org> References: <1328679700-31015-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 2/4] Make -machine/-enable-kvm options merge into a single list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Grant Likely , Anthony Liguori , Alexander Graf , patches@linaro.org Make the "machine" option list use list merging, so that multiple -machine arguments (and the -enable-kvm argument) all merge together into a single list. Drop the calls to qemu_opts_reset() which meant that only the last -machine or -enable-kvm option had any effect. This fixes the bug where "-enable-kvm -machine foo" would ignore the '-enable-kvm' option, and "-machine foo -enable-kvm" would ignore the '-machine foo' option. Signed-off-by: Peter Maydell --- qemu-config.c | 1 + vl.c | 2 -- 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/qemu-config.c b/qemu-config.c index b030205..c938470 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -521,6 +521,7 @@ QemuOptsList qemu_option_rom_opts = { static QemuOptsList qemu_machine_opts = { .name = "machine", .implied_opt_name = "type", + .merge_lists = true, .head = QTAILQ_HEAD_INITIALIZER(qemu_machine_opts.head), .desc = { { diff --git a/vl.c b/vl.c index 63dd725..fe24ef8 100644 --- a/vl.c +++ b/vl.c @@ -2874,12 +2874,10 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_enable_kvm: olist = qemu_find_opts("machine"); - qemu_opts_reset(olist); qemu_opts_parse(olist, "accel=kvm", 0); break; case QEMU_OPTION_machine: olist = qemu_find_opts("machine"); - qemu_opts_reset(olist); opts = qemu_opts_parse(olist, optarg, 1); if (!opts) { fprintf(stderr, "parse error: %s\n", optarg); -- 1.7.5.4