From: "Andreas Färber" <afaerber@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] qom: fix device hot-unplug
Date: Sat, 10 Mar 2012 14:12:05 +0100 [thread overview]
Message-ID: <4F5B5325.2000103@suse.de> (raw)
In-Reply-To: <1330419255-5566-3-git-send-email-pbonzini@redhat.com>
Am 28.02.2012 09:54, schrieb Paolo Bonzini:
> Property removal modifies the list, so it is not safe to continue
> iteration. We know anyway that each object can have only one
> parent (see object_property_add_child), so exit after finding
> the requested object.
>
> Reported-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> qom/object.c | 7 ++-----
> 1 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/qom/object.c b/qom/object.c
> index aa037d2..39cbcb9 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -304,12 +304,9 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp)
> ObjectProperty *prop;
>
> QTAILQ_FOREACH(prop, &obj->properties, node) {
> - if (!strstart(prop->type, "child<", NULL)) {
> - continue;
> - }
> -
> - if (prop->opaque == child) {
> + if (strstart(prop->type, "child<", NULL) && prop->opaque == child) {
Didn't someone post a patch introducing an object_property_is_child() or
so? Would be handy here.
Otherwise looks okay.
Andreas
> object_property_del(obj, prop->name, errp);
> + break;
> }
> }
> }
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-03-10 13:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-28 8:54 [Qemu-devel] [PATCH 0/2] Two small QOM fixes Paolo Bonzini
2012-02-28 8:54 ` [Qemu-devel] [PATCH 1/2] qdev: accept empty string properties Paolo Bonzini
2012-02-28 18:53 ` Gerhard Wiesinger
2012-03-10 13:14 ` Andreas Färber
2012-02-28 8:54 ` [Qemu-devel] [PATCH 2/2] qom: fix device hot-unplug Paolo Bonzini
2012-03-10 13:12 ` Andreas Färber [this message]
2012-03-09 20:15 ` [Qemu-devel] [PATCH 0/2] Two small QOM fixes Paolo Bonzini
2012-03-13 1:59 ` 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=4F5B5325.2000103@suse.de \
--to=afaerber@suse.de \
--cc=mst@redhat.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 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.