aboutsummaryrefslogtreecommitdiff
path: root/hw/pc_piix.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-03-27 18:38:46 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2012-04-02 15:04:15 -0500
commitf424d5c4c9de67b56594384eac3c08dc33de9344 (patch)
tree0559a455e18c7b0cd342c33e11474702685dca1e /hw/pc_piix.c
parenta612b2a6635fa1a3a29a8bcf41b31f1f3fae1110 (diff)
qdev: add children before qdev_init
We want the composition tree to to be in order by the time we call qdev_init, so that a single set of the toplevel realize property can propagate all the way down the composition tree. This is not the case so far. Unfortunately, this is incompatible with calling qdev_init in the constructor wrappers for devices, so for now we need to unattach some devices that are created through those wrappers. This will be fixed by removing qdev_init and instead setting the toplevel realize property after machine init. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pc_piix.c')
-rw-r--r--hw/pc_piix.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index ec5118f848..fadca4c710 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -149,7 +149,6 @@ static void pc_init1(MemoryRegion *system_memory,
MemoryRegion *ram_memory;
MemoryRegion *pci_memory;
MemoryRegion *rom_memory;
- DeviceState *dev;
pc_cpus_init(cpu_model);
@@ -227,11 +226,7 @@ static void pc_init1(MemoryRegion *system_memory,
pc_register_ferr_irq(gsi[13]);
- dev = pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
- if (dev) {
- object_property_add_child(object_get_root(), "vga", OBJECT(dev), NULL);
- }
-
+ pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
if (xen_enabled()) {
pci_create_simple(pci_bus, -1, "xen-platform");
}
@@ -258,17 +253,6 @@ static void pc_init1(MemoryRegion *system_memory,
}
idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0");
idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1");
-
- /* FIXME there's some major spaghetti here. Somehow we create the
- * devices on the PIIX before we actually create it. We create the
- * PIIX3 deep in the recess of the i440fx creation too and then lose
- * the DeviceState.
- *
- * For now, let's "fix" this by making judicious use of paths. This
- * is not generally the right way to do this.
- */
- object_property_add_child(object_resolve_path("/i440fx/piix3", NULL),
- "rtc", (Object *)rtc_state, NULL);
} else {
for(i = 0; i < MAX_IDE_BUS; i++) {
ISADevice *dev;