From patchwork Wed Mar 24 19:26:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 48461 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D8BAFB7C98 for ; Thu, 25 Mar 2010 06:31:21 +1100 (EST) Received: from localhost ([127.0.0.1]:56727 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuWIP-0006Nb-NY for incoming@patchwork.ozlabs.org; Wed, 24 Mar 2010 15:31:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuWEG-000515-02 for qemu-devel@nongnu.org; Wed, 24 Mar 2010 15:27:00 -0400 Received: from [140.186.70.92] (port=53497 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuWE9-0004qC-8J for qemu-devel@nongnu.org; Wed, 24 Mar 2010 15:26:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuWDk-0007IA-UG for qemu-devel@nongnu.org; Wed, 24 Mar 2010 15:26:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60761) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuWDk-0007Gp-LR for qemu-devel@nongnu.org; Wed, 24 Mar 2010 15:26:28 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2OJQQ4n021693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Mar 2010 15:26:26 -0400 Received: from localhost.localdomain (vpn-10-24.rdu.redhat.com [10.11.10.24]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2OJQNtQ030961; Wed, 24 Mar 2010 15:26:25 -0400 From: Glauber Costa To: qemu-devel@nongnu.org Date: Wed, 24 Mar 2010 16:26:21 -0300 Message-Id: <1269458782-6123-2-git-send-email-glommer@redhat.com> In-Reply-To: <1269458782-6123-1-git-send-email-glommer@redhat.com> References: <1269458782-6123-1-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com, avi@redhat.com Subject: [Qemu-devel] [PATCH 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. --- vl.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index d69250c..ceddeac 100644 --- a/vl.c +++ b/vl.c @@ -4841,6 +4841,9 @@ int main(int argc, char **argv, char **envp) } qemu_add_globals(); + + current_machine = machine; + machine->init(ram_size, boot_devices, kernel_filename, kernel_cmdline, initrd_filename, cpu_model); @@ -4859,8 +4862,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)