Commit 6c1fdcf9 authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Anthony Liguori
Browse files

qom: fix device hot-unplug

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: default avatarMichael S. Tsirkin <>
Signed-off-by: default avatarPaolo Bonzini <>
Signed-off-by: default avatarAnthony Liguori <>
parent 66d341e5
...@@ -304,12 +304,9 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp) ...@@ -304,12 +304,9 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp)
ObjectProperty *prop; ObjectProperty *prop;
QTAILQ_FOREACH(prop, &obj->properties, node) { QTAILQ_FOREACH(prop, &obj->properties, node) {
if (!strstart(prop->type, "child<", NULL)) { if (strstart(prop->type, "child<", NULL) && prop->opaque == child) {
if (prop->opaque == child) {
object_property_del(obj, prop->name, errp); object_property_del(obj, prop->name, errp);
} }
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment