From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34889 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKAGS-0002P3-G5 for qemu-devel@nongnu.org; Thu, 03 Jun 2010 09:15:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKAG8-0000C0-An for qemu-devel@nongnu.org; Thu, 03 Jun 2010 09:15:01 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:33879) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKAG8-0000Br-62 for qemu-devel@nongnu.org; Thu, 03 Jun 2010 09:14:56 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by e4.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o53D1sgP011612 for ; Thu, 3 Jun 2010 09:01:54 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o53DErZ41269822 for ; Thu, 3 Jun 2010 09:14:54 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o53DErgJ010941 for ; Thu, 3 Jun 2010 09:14:53 -0400 Message-ID: <4C07AACC.2080202@linux.vnet.ibm.com> Date: Thu, 03 Jun 2010 08:14:52 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1275414976-18258-1-git-send-email-glommer@redhat.com> <1275414976-18258-2-git-send-email-glommer@redhat.com> In-Reply-To: <1275414976-18258-2-git-send-email-glommer@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v2 1/2] early set current_machine List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber Costa Cc: qemu-devel@nongnu.org On 06/01/2010 12:56 PM, Glauber Costa wrote: > this way, the machine_init function itself can know which machine is current > in use, not only the late init code. > While your touching it... We only use current_machine in hw/device-hotplug.c. I think it would be better to introduce an accessor function (get_current_machine()) and then make this global static. Regards, Anthony Liguori > 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) >