From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJQEr-000787-Cp for qemu-devel@nongnu.org; Wed, 03 Oct 2012 10:47:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJQEk-00046n-D6 for qemu-devel@nongnu.org; Wed, 03 Oct 2012 10:47:53 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:32889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJQEk-00046a-6q for qemu-devel@nongnu.org; Wed, 03 Oct 2012 10:47:46 -0400 Received: by pbbrp2 with SMTP id rp2so10071572pbb.4 for ; Wed, 03 Oct 2012 07:47:45 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <506C4E46.2050106@redhat.com> Date: Wed, 03 Oct 2012 16:40:06 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1349270954-4657-1-git-send-email-ehabkost@redhat.com> <1349270954-4657-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1349270954-4657-3-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 02/18] pc: create PC object on pc_init1() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Igor Mammedov , qemu-devel@nongnu.org, Gleb Natapov , =?ISO-8859-1?Q?Andreas_F=E4rber?= Il 03/10/2012 15:28, Eduardo Habkost ha scritto: > It would be interesting to make the generic machine intialization code > create a machine object instead, but changing the machine initialization > function signature is a nightmare, so by now I am creating the object > inside pc_init1(). > > The object is not used for anything by now, but it will be used during > some steps of the initialization, later. > > Signed-off-by: Eduardo Habkost > --- > hw/pc_piix.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/hw/pc_piix.c b/hw/pc_piix.c > index fd5898f..28b5f8a 100644 > --- a/hw/pc_piix.c > +++ b/hw/pc_piix.c > @@ -148,6 +148,7 @@ static void pc_init1(MemoryRegion *system_memory, > MemoryRegion *pci_memory; > MemoryRegion *rom_memory; > void *fw_cfg = NULL; > + PC *pc = PC(object_new(TYPE_PC_MACHINE)); > > pc_cpus_init(cpu_model); > > @@ -285,6 +286,8 @@ static void pc_init1(MemoryRegion *system_memory, > if (pci_enabled) { > pc_pci_device_init(pci_bus); > } > + > + qdev_init_nofail(DEVICE(pc)); > } > > static void pc_init_pci(ram_addr_t ram_size, > Can you add a hook to QEMUMachine so that this object is created by qdev_get_machine() and ends up at /machine? Paolo