aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-05-05 17:29:26 +0200
committerMarkus Armbruster <armbru@redhat.com>2020-05-15 07:08:14 +0200
commitdf4fe0b291b2baf1694517a4a67be7525102656b (patch)
treeefcad1374a17a455adaec478e7f5f3f66cdfa296 /qom
parent7ef1553dac8ef8dbe547b58d7420461a16be0eeb (diff)
qom: Drop @errp parameter of object_property_del()
Same story as for object_property_add(): the only way object_property_del() can fail is when the property with this name does not exist. Since our property names are all hardcoded, failure is a programming error, and the appropriate way to handle it is passing &error_abort. Most callers do that, the commit before previous fixed one that didn't (and got the error handling wrong), and the two remaining exceptions ignore errors. Drop the @errp parameter. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200505152926.18877-19-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c7
-rw-r--r--qom/object_interfaces.c3
2 files changed, 2 insertions, 8 deletions
diff --git a/qom/object.c b/qom/object.c
index 23f481ca46..e89ffbe3d1 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1280,15 +1280,10 @@ ObjectProperty *object_class_property_find(ObjectClass *klass, const char *name,
return prop;
}
-void object_property_del(Object *obj, const char *name, Error **errp)
+void object_property_del(Object *obj, const char *name)
{
ObjectProperty *prop = g_hash_table_lookup(obj->properties, name);
- if (!prop) {
- error_setg(errp, "Property '.%s' not found", name);
- return;
- }
-
if (prop->release) {
prop->release(obj, name, prop->opaque);
}
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index 054e75043d..7e26f86fa6 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -89,8 +89,7 @@ Object *user_creatable_add_type(const char *type, const char *id,
user_creatable_complete(USER_CREATABLE(obj), &local_err);
if (local_err) {
if (id != NULL) {
- object_property_del(object_get_objects_root(),
- id, &error_abort);
+ object_property_del(object_get_objects_root(), id);
}
goto out;
}