From patchwork Wed Feb 8 05:41:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 6707 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 49B8E23EAA for ; Wed, 8 Feb 2012 05:41:51 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 13BF2A180B4 for ; Wed, 8 Feb 2012 05:41:50 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id z7so480239iab.11 for ; Tue, 07 Feb 2012 21:41:50 -0800 (PST) Received: by 10.50.216.231 with SMTP id ot7mr24718279igc.8.1328679710681; Tue, 07 Feb 2012 21:41:50 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.169.210 with SMTP id a18cs5062ibz; Tue, 7 Feb 2012 21:41:50 -0800 (PST) Received: by 10.68.222.194 with SMTP id qo2mr64971088pbc.20.1328679707663; Tue, 07 Feb 2012 21:41:47 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id j9si1431790pbh.88.2012.02.07.21.41.46 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Feb 2012 21:41:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Rv0Hk-00084k-VT; Wed, 08 Feb 2012 05:41:40 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Grant Likely , Anthony Liguori , Alexander Graf Subject: [PATCH 2/4] Make -machine/-enable-kvm options merge into a single list Date: Wed, 8 Feb 2012 05:41:38 +0000 Message-Id: <1328679700-31015-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1328679700-31015-1-git-send-email-peter.maydell@linaro.org> References: <1328679700-31015-1-git-send-email-peter.maydell@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);