qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 02/18] pc: create PC object on pc_init1()


From: Eduardo Habkost
Subject: [Qemu-devel] [RFC 02/18] pc: create PC object on pc_init1()
Date: Wed, 3 Oct 2012 10:28:58 -0300

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 <address@hidden>
---
 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,
-- 
1.7.11.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]