From patchwork Tue Jan 6 17:41:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 425755 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 AEF94140082 for ; Wed, 7 Jan 2015 04:41:54 +1100 (AEDT) Received: from localhost ([::1]:37495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8Y8d-0001GV-94 for incoming@patchwork.ozlabs.org; Tue, 06 Jan 2015 12:41:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8Y8K-0000tO-Gc for qemu-devel@nongnu.org; Tue, 06 Jan 2015 12:41:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8Y8G-0003gd-5R for qemu-devel@nongnu.org; Tue, 06 Jan 2015 12:41:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8Y8F-0003g7-Tt; Tue, 06 Jan 2015 12:41:28 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t06HfMAt021758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Jan 2015 12:41:22 -0500 Received: from work.tlv.redhat.com (dhcp-4-230.tlv.redhat.com [10.35.4.230]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t06HfJvm012819; Tue, 6 Jan 2015 12:41:20 -0500 From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Tue, 6 Jan 2015 19:41:18 +0200 Message-Id: <1420566078-27649-1-git-send-email-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, armbru@redhat.com, qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH] 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 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 --- vl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vl.c b/vl.c index 7786b2f..ecd8c93 100644 --- a/vl.c +++ b/vl.c @@ -3659,6 +3659,11 @@ int main(int argc, char **argv, char **envp) strerror(-ret)); exit(1); } + opts = qemu_get_machine_opts(); + optarg = qemu_opt_get(opts, "type"); + if (optarg) { + machine_class = machine_parse(optarg); + } break; } case QEMU_OPTION_spice: