qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: aliguori@linux.vnet.ibm.com, aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 4/4] qdev: put all devices under /machine
Date: Wed, 28 Mar 2012 17:10:21 +0200	[thread overview]
Message-ID: <4F7329DD.8030803@suse.de> (raw)
In-Reply-To: <1332945252-19025-1-git-send-email-pbonzini@redhat.com>

Am 28.03.2012 16:34, schrieb Paolo Bonzini:
> Avoid cluttering too much the QOM root.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@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

  reply	other threads:[~2012-03-28 15:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 16:38 [Qemu-devel] [PATCH 0/4] qdev: give all devices a canonical QOM path Paolo Bonzini
2012-03-27 16:38 ` [Qemu-devel] [PATCH 1/4] qom: add container_get Paolo Bonzini
2012-03-27 21:07   ` Anthony Liguori
2012-03-27 16:38 ` [Qemu-devel] [PATCH 2/4] qdev: add children before qdev_init Paolo Bonzini
2012-03-27 21:08   ` Anthony Liguori
2012-03-27 16:38 ` [Qemu-devel] [PATCH 3/4] qdev: give all devices a canonical path Paolo Bonzini
2012-03-27 21:12   ` Anthony Liguori
2012-03-27 16:38 ` [Qemu-devel] [PATCH 4/4] qdev: put all devices under /machine Paolo Bonzini
2012-03-27 21:11   ` Anthony Liguori
2012-03-28 14:01     ` Andreas Färber
2012-03-28 14:34       ` [Qemu-devel] [PATCH v2 " Paolo Bonzini
2012-03-28 15:10         ` Andreas Färber [this message]
2012-03-28 15:19           ` Paolo Bonzini
2012-04-05 11:21             ` [Qemu-devel] [PATCH] qom: Refine container_get() to allow using a custom root Andreas Färber
2012-04-05 11:30               ` Paolo Bonzini
2012-03-27 16:42 ` [Qemu-devel] [PATCH 0/4] qdev: give all devices a canonical QOM path Anthony Liguori
2012-04-02 21:21 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F7329DD.8030803@suse.de \
    --to=afaerber@suse.de \
    --cc=aliguori@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).