From patchwork Wed Jan 14 09:41:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 428882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 04BDD14012C for ; Wed, 14 Jan 2015 20:42:23 +1100 (AEDT) Received: from localhost ([::1]:45223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBKSw-0003Lc-IR for incoming@patchwork.ozlabs.org; Wed, 14 Jan 2015 04:42:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBKSN-0002Xw-UX for qemu-devel@nongnu.org; Wed, 14 Jan 2015 04:41:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBKSM-00006N-VJ for qemu-devel@nongnu.org; Wed, 14 Jan 2015 04:41:43 -0500 Received: from mail-we0-x234.google.com ([2a00:1450:400c:c03::234]:54145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBKSM-00006C-Np; Wed, 14 Jan 2015 04:41:42 -0500 Received: by mail-we0-f180.google.com with SMTP id w62so7663739wes.11; Wed, 14 Jan 2015 01:41:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=KAiY7S1VpH1lDOBGOv9jT+V9j1/FbhTIGgHjr0/caGo=; b=Ok9qrUUq6o+6rfqs8f/p3l6GCNSsqXbWX/wBqsXZiDyRvY8c5xLtKZvERyFcg/zxN4 QmUBNBSxitCv8kvsQSdtTQn7O8cP3jjuEFsijOb+qI3S35RJQz8RYqN9OiDfdwVzS2xG +eIGoNi+IgW0v9FIcUqaC86IFGTZp4ZP4BZ8RKeqCxpGC6UIF9YgBiwKQLJDGW1RvCt2 xL+TLhrueUIIzlPpLTM65THGLwfe1w8g0GLoDuXKy5OvvCXbUT6zzmND+vG/aefDfCMG 65AqJAHivdmuxgGf8kHnW9p1WM5JvRjHPWbqIQzMEgp2qEmyrRVo9C9r3cKLdOYYybs9 /r7w== X-Received: by 10.194.161.170 with SMTP id xt10mr5720758wjb.4.1421228502069; Wed, 14 Jan 2015 01:41:42 -0800 (PST) Received: from playground.station (net-37-117-129-192.cust.vodafonedsl.it. [37.117.129.192]) by mx.google.com with ESMTPSA id hn2sm29298235wjc.5.2015.01.14.01.41.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jan 2015 01:41:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 14 Jan 2015 10:41:19 +0100 Message-Id: <1421228492-19856-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1421228492-19856-1-git-send-email-pbonzini@redhat.com> References: <1421228492-19856-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::234 Cc: Marcel Apfelbaum , qemu-stable@nongnu.org Subject: [Qemu-devel] [PULL 02/15] vl.c: fix regression when reading machine type from config file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Apfelbaum After 'Machine as QOM' series the machine type input triggers the creation of the machine class. If the machine type is set in the configuration file, the machine class is not updated accordingly and remains the default. Fixed that by querying the machine options after the configuration file is loaded. Cc: qemu-stable@nongnu.org Reported-by: William Dauchy Signed-off-by: Marcel Apfelbaum Signed-off-by: Paolo Bonzini --- vl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/vl.c b/vl.c index 7786b2f..1a2da2b 100644 --- a/vl.c +++ b/vl.c @@ -2796,9 +2796,6 @@ int main(int argc, char **argv, char **envp) exit(1); } switch(popt->index) { - case QEMU_OPTION_M: - machine_class = machine_parse(optarg); - break; case QEMU_OPTION_no_kvm_irqchip: { olist = qemu_find_opts("machine"); qemu_opts_parse(olist, "kernel_irqchip=off", 0); @@ -3420,16 +3417,13 @@ int main(int argc, char **argv, char **envp) olist = qemu_find_opts("machine"); qemu_opts_parse(olist, "accel=kvm", 0); break; + case QEMU_OPTION_M: case QEMU_OPTION_machine: olist = qemu_find_opts("machine"); opts = qemu_opts_parse(olist, optarg, 1); if (!opts) { exit(1); } - optarg = qemu_opt_get(opts, "type"); - if (optarg) { - machine_class = machine_parse(optarg); - } break; case QEMU_OPTION_no_kvm: olist = qemu_find_opts("machine"); @@ -3752,6 +3746,13 @@ int main(int argc, char **argv, char **envp) } } } + + opts = qemu_get_machine_opts(); + optarg = qemu_opt_get(opts, "type"); + if (optarg) { + machine_class = machine_parse(optarg); + } + loc_set_none(); os_daemonize();