Am 28.03.2012 16:34, schrieb Paolo Bonzini: > Avoid cluttering too much the QOM root. > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > v1->v2: add qdev_get_machine() and use it.
Thanks, > > hw/piix_pci.c | 2 +- > hw/ppc_prep.c | 2 +- > hw/qdev-monitor.c | 4 ++-- > hw/qdev.c | 13 ++++++++++++- > hw/qdev.h | 2 ++ > 5 files changed, 18 insertions(+), 5 deletions(-) > > diff --git a/hw/piix_pci.c b/hw/piix_pci.c > index 9017565..179d9a6 100644 > --- a/hw/piix_pci.c > +++ b/hw/piix_pci.c > @@ -276,7 +276,7 @@ static PCIBus *i440fx_common_init(const char *device_name, > b = pci_bus_new(&s->busdev.qdev, NULL, pci_address_space, > address_space_io, 0); > s->bus = b; > - object_property_add_child(object_get_root(), "i440fx", OBJECT(dev), > NULL); > + object_property_add_child(qdev_get_machine(), "i440fx", OBJECT(dev), > NULL); > qdev_init_nofail(dev); > > d = pci_create_simple(b, 0, device_name); > diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c > index 86c9336..9d8e659 100644 > --- a/hw/ppc_prep.c > +++ b/hw/ppc_prep.c > @@ -615,7 +615,7 @@ static void ppc_prep_init (ram_addr_t ram_size, > sys = sysbus_from_qdev(dev); > pcihost = DO_UPCAST(PCIHostState, busdev, sys); > pcihost->address_space = get_system_memory(); > - object_property_add_child(object_get_root(), "raven", OBJECT(dev), NULL); > + object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev), > NULL); > qdev_init_nofail(dev); > pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0"); > if (pci_bus == NULL) { > diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c > index 031cb83..4783366 100644 > --- a/hw/qdev-monitor.c > +++ b/hw/qdev-monitor.c > @@ -180,7 +180,7 @@ static Object *qdev_get_peripheral(void) > static Object *dev; > > if (dev == NULL) { > - dev = container_get("/peripheral"); > + dev = container_get("/machine/peripheral"); I was kinda hoping we could even do something like this in 1/4: container_get_relative(qdev_get_machine(), "peripheral"); w/ container_get(bla) -> container_get_relative(object_get_root(), bla). Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg