All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: bsd@redhat.com, qemu-devel <qemu-devel@nongnu.org>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] Use-after-free during unrealize in system_reset
Date: Fri, 06 Jun 2014 11:52:46 +0200	[thread overview]
Message-ID: <53918F6E.1020406@redhat.com> (raw)
In-Reply-To: <CAJSP0QWy_xg00mN8bLr_VR71HFB=+RV2KK2+B5zScBn9pM-POQ@mail.gmail.com>

Il 06/06/2014 11:03, Stefan Hajnoczi ha scritto:
> commit 5c21ce77d7e5643089ceec556c0408445d017f32
> Author: Bandan Das <bsd@redhat.com>
> Date:   Wed Mar 12 21:02:12 2014 +0100
>
>     qdev: Realize buses on device realization
>
>     Integrate (un)realization of child buses with realization/unrealization
>     of the device hosting them. Code in device_unparent() is reordered for
>     unrealization of buses to work as part of device unrealization.
>
>     That way no changes need to be made to bus instantiation.
>
>     Signed-off-by: Bandan Das <bsd@redhat.com>
>     Signed-off-by: Andreas Färber <afaerber@suse.de>

This hunk seems wrong.  Bandan, what was the reason for it?


@@ -841,13 +858,13 @@ static void device_unparent(Object *obj)
      QObject *event_data;
      bool have_realized = dev->realized;

+    if (dev->realized) {
+        object_property_set_bool(obj, false, "realized", NULL);
+    }
      while (dev->num_child_bus) {
          bus = QLIST_FIRST(&dev->child_bus);
          object_unparent(OBJECT(bus));
      }
-    if (dev->realized) {
-        object_property_set_bool(obj, false, "realized", NULL);
-    }
      if (dev->parent_bus) {
          bus_remove_child(dev->parent_bus, dev);
          object_unref(OBJECT(dev->parent_bus));



Paolo

  reply	other threads:[~2014-06-06  9:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 15:31 [Qemu-devel] Use-after-free during unrealize in system_reset Stefan Hajnoczi
2014-06-05 16:18 ` Michael S. Tsirkin
2014-06-06  9:03   ` Stefan Hajnoczi
2014-06-06  9:52     ` Paolo Bonzini [this message]
2014-06-08 10:46       ` Michael S. Tsirkin
2014-06-08 14:40         ` Paolo Bonzini
2014-06-08 14:52           ` Michael S. Tsirkin
2014-06-08 14:52           ` Michael S. Tsirkin
2014-06-09  7:51             ` Paolo Bonzini
2014-06-09  8:15               ` Michael S. Tsirkin
2014-06-09 17:02           ` Bandan Das
2014-06-11 12:03             ` Andreas Färber
2014-06-11 12:24               ` Paolo Bonzini
2014-06-11 15:51               ` Bandan Das

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=53918F6E.1020406@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=bsd@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.