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: peter.maydell@linaro.org, aliguori@us.ibm.com,
	qemu-devel@nongnu.org, Liu Ping Fan <qemulist@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 1.3 2/5] qdev: move bus removal to object_unparent
Date: Tue, 27 Nov 2012 02:02:21 +0100	[thread overview]
Message-ID: <50B4111D.4060900@suse.de> (raw)
In-Reply-To: <1353660436-8897-3-git-send-email-pbonzini@redhat.com>

Am 23.11.2012 09:47, schrieb Paolo Bonzini:
> diff --git a/hw/qdev.c b/hw/qdev.c
> index 7ddcd24..f43717b 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
[...]
> @@ -720,6 +717,18 @@ static void device_class_base_init(ObjectClass *class, void *data)
>      klass->props = NULL;
>  }
>  
> +static void qdev_remove_from_bus(Object *obj)
> +{
> +    DeviceState *dev = DEVICE(obj);
> +
> +    bus_remove_child(dev->parent_bus, dev);
> +}
> +
> +static void device_class_init(ObjectClass *class, void *data)
> +{
> +    class->unparent = qdev_remove_from_bus;

Ouch, patch for 1.4 coming up. :)

Andreas

> +}
> +
>  void device_reset(DeviceState *dev)
>  {
>      DeviceClass *klass = DEVICE_GET_CLASS(dev);
> @@ -747,6 +756,7 @@ static TypeInfo device_type_info = {
>      .instance_init = device_initfn,
>      .instance_finalize = device_finalize,
>      .class_base_init = device_class_base_init,
> +    .class_init = device_class_init,
>      .abstract = true,
>      .class_size = sizeof(DeviceClass),
>  };

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  parent reply	other threads:[~2012-11-27  1:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23  8:47 [Qemu-devel] [PATCH 1.3 0/5] QOM/qdev lifetime fixes Paolo Bonzini
2012-11-23  8:47 ` [Qemu-devel] [PATCH 1.3 1/5] qom: fix refcount of non-heap-allocated objects Paolo Bonzini
2012-11-23 16:49   ` Andreas Färber
2012-11-26 15:49   ` Anthony Liguori
2012-11-26 16:08     ` Paolo Bonzini
2012-11-23  8:47 ` [Qemu-devel] [PATCH 1.3 2/5] qdev: move bus removal to object_unparent Paolo Bonzini
2012-11-23 16:52   ` Andreas Färber
2012-11-27  1:02   ` Andreas Färber [this message]
2012-11-23  8:47 ` [Qemu-devel] [PATCH 1.3 3/5] qom: make object_delete usable for statically-allocated objects Paolo Bonzini
2012-11-23 17:02   ` Andreas Färber
2012-11-23 17:10     ` Paolo Bonzini
2012-11-23  8:47 ` [Qemu-devel] [PATCH 1.3 4/5] qdev: simplify (de)allocation of buses Paolo Bonzini
2012-11-23 17:07   ` Andreas Färber
2012-11-23 17:16     ` Paolo Bonzini
2012-11-23  8:47 ` [Qemu-devel] [PATCH 1.3 5/5] qom: make object_finalize static Paolo Bonzini
2012-11-23 17:12   ` Andreas Färber
2012-11-23 17:32     ` Paolo Bonzini
2012-11-26 21:47 ` [Qemu-devel] [PATCH 1.3 0/5] QOM/qdev lifetime fixes 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=50B4111D.4060900@suse.de \
    --to=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemulist@gmail.com \
    /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).