From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCtRt-0000nf-GZ for qemu-devel@nongnu.org; Wed, 28 Mar 2012 10:02:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCtRj-0008UG-GN for qemu-devel@nongnu.org; Wed, 28 Mar 2012 10:02:05 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46054 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCtRj-0008U1-6j for qemu-devel@nongnu.org; Wed, 28 Mar 2012 10:01:55 -0400 Message-ID: <4F7319CF.50909@suse.de> Date: Wed, 28 Mar 2012 16:01:51 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1332866328-25443-1-git-send-email-pbonzini@redhat.com> <1332866328-25443-5-git-send-email-pbonzini@redhat.com> <4F722D0E.7080900@us.ibm.com> In-Reply-To: <4F722D0E.7080900@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 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, Anthony Liguori , qemu-devel@nongnu.org Am 27.03.2012 23:11, schrieb Anthony Liguori: > On 03/27/2012 11:38 AM, Paolo Bonzini wrote: >> Avoid cluttering too much the QOM root. >> >> Signed-off-by: Paolo Bonzini >=20 > Reviewed-by: Anthony Liguori Not terribly convinced, but no better suggestion. Could you please not hardcode this everywhere but supply a machine_get() helper? My idea would be that what is now just a container gets replaced by the future QOM machine object. I.e. object_get_root() -> machine_get() or whatever we want to call it, calling container_get("/machine"). Andreas >=20 > Regards, >=20 > Anthony Liguori >=20 >> --- >> hw/piix_pci.c | 2 +- >> hw/ppc_prep.c | 2 +- >> hw/qdev-monitor.c | 4 ++-- >> hw/qdev.c | 2 +- >> 4 files changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/hw/piix_pci.c b/hw/piix_pci.c >> index 9017565..bd20a16 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 =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(container_get("/machine"), "i440fx", >> OBJECT(dev), NULL); >> qdev_init_nofail(dev); >> >> d =3D pci_create_simple(b, 0, device_name); >> diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c >> index 86c9336..d06fc5e 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(container_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; >> >> if (dev =3D=3D NULL) { >> - dev =3D container_get("/peripheral"); >> + dev =3D container_get("/machine/peripheral"); >> } >> >> return dev; >> @@ -191,7 +191,7 @@ static Object *qdev_get_peripheral_anon(void) >> static Object *dev; >> >> if (dev =3D=3D NULL) { >> - dev =3D container_get("/peripheral-anon"); >> + dev =3D container_get("/machine/peripheral-anon"); >> } >> >> return dev; >> diff --git a/hw/qdev.c b/hw/qdev.c >> index f5c716e..60e5081 100644 >> --- a/hw/qdev.c >> +++ b/hw/qdev.c >> @@ -157,7 +157,7 @@ int qdev_init(DeviceState *dev) >> static int unattached_count =3D 0; >> gchar *name =3D g_strdup_printf("device[%d]", >> unattached_count++); >> >> - object_property_add_child(container_get("/unattached"), name, >> + =20 >> object_property_add_child(container_get("/machine/unattached"), name, >> OBJECT(dev), NULL); >> g_free(name); >> } >=20 --=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