diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-23 15:34:39 -0600 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-06-18 15:14:38 +0200 |
commit | 0866aca1de15a12547f52ff8563cf7c163e1898e (patch) | |
tree | 511c043eb3de19d479f708209e588d828b751903 /qom/object.c | |
parent | f968fc6892daf02865cce8af277cc755be690eda (diff) |
qbus: Make child devices links
Make qbus children show up as link<> properties. There is no stable
addressing for qbus children so we use an unstable naming convention.
This is okay in QOM though because the composition name is expected to
be what's stable.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'qom/object.c')
-rw-r--r-- | qom/object.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/qom/object.c b/qom/object.c index d5c6ff7471..27cc651a91 100644 --- a/qom/object.c +++ b/qom/object.c @@ -689,9 +689,16 @@ void object_property_del(Object *obj, const char *name, Error **errp) { ObjectProperty *prop = object_property_find(obj, name); - QTAILQ_REMOVE(&obj->properties, prop, node); + if (prop == NULL) { + error_set(errp, QERR_PROPERTY_NOT_FOUND, "", name); + return; + } + + if (prop->release) { + prop->release(obj, name, prop->opaque); + } - prop->release(obj, prop->name, prop->opaque); + QTAILQ_REMOVE(&obj->properties, prop, node); g_free(prop->name); g_free(prop->type); |