From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCuW8-0005jx-2J for qemu-devel@nongnu.org; Wed, 28 Mar 2012 11:10:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCuW1-0001h0-Ln for qemu-devel@nongnu.org; Wed, 28 Mar 2012 11:10:31 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53840 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCuW1-0001gn-Cj for qemu-devel@nongnu.org; Wed, 28 Mar 2012 11:10:25 -0400 Message-ID: <4F7329DD.8030803@suse.de> Date: Wed, 28 Mar 2012 17:10:21 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1332945252-19025-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1332945252-19025-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 4/4] qdev: put all devices under /machine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aliguori@linux.vnet.ibm.com, aliguori@us.ibm.com, qemu-devel@nongnu.org Am 28.03.2012 16:34, schrieb Paolo Bonzini: > Avoid cluttering too much the QOM root. >=20 > Signed-off-by: Paolo Bonzini > --- > v1->v2: add qdev_get_machine() and use it. Thanks, >=20 > 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(-) >=20 > 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 *devic= e_name, > b =3D pci_bus_new(&s->busdev.qdev, NULL, pci_address_space, > address_space_io, 0); > s->bus =3D 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); > =20 > d =3D 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 =3D sysbus_from_qdev(dev); > pcihost =3D DO_UPCAST(PCIHostState, busdev, sys); > pcihost->address_space =3D 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 =3D (PCIBus *)qdev_get_child_bus(dev, "pci.0"); > if (pci_bus =3D=3D 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; > =20 > if (dev =3D=3D NULL) { > - dev =3D container_get("/peripheral"); > + dev =3D 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 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg