From patchwork Tue Jun 1 17:56:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 54271 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by ozlabs.org (Postfix) with ESMTP id 89402B6F11 for ; Wed, 2 Jun 2010 04:10:57 +1000 (EST) Received: from localhost ([127.0.0.1]:55306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJVqY-0003vx-WC for incoming@patchwork.ozlabs.org; Tue, 01 Jun 2010 14:05:51 -0400 Received: from [140.186.70.92] (port=59123 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJVpW-0003s8-5B for qemu-devel@nongnu.org; Tue, 01 Jun 2010 14:04:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJVpL-0001Je-VW for qemu-devel@nongnu.org; Tue, 01 Jun 2010 14:04:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61161) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJVpL-0001JR-PQ for qemu-devel@nongnu.org; Tue, 01 Jun 2010 14:04:35 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o51I4YpE020418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 1 Jun 2010 14:04:34 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o51I4Wn0020170; Tue, 1 Jun 2010 14:04:34 -0400 From: Glauber Costa To: qemu-devel@nongnu.org Date: Tue, 1 Jun 2010 13:56:15 -0400 Message-Id: <1275414976-18258-2-git-send-email-glommer@redhat.com> In-Reply-To: <1275414976-18258-1-git-send-email-glommer@redhat.com> References: <1275414976-18258-1-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH v2 1/2] early set current_machine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org this way, the machine_init function itself can know which machine is current in use, not only the late init code. Signed-off-by: Glauber Costa --- vl.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 96838f8..7a8b20b 100644 --- a/vl.c +++ b/vl.c @@ -5824,6 +5824,9 @@ int main(int argc, char **argv, char **envp) if (machine->compat_props) { qdev_prop_register_compat(machine->compat_props); } + + current_machine = machine; + machine->init(ram_size, boot_devices, kernel_filename, kernel_cmdline, initrd_filename, cpu_model); @@ -5841,8 +5844,6 @@ int main(int argc, char **argv, char **envp) } } - current_machine = machine; - /* init USB devices */ if (usb_enabled) { if (foreach_device_config(DEV_USB, usb_parse) < 0)