On 4/28/20 11:34 AM, Markus Armbruster wrote:
Some object_property_add_FOO() return the newly added property, some
don't. Clean that up.
Signed-off-by: Markus Armbruster <arm...@redhat.com>
---
include/qom/object.h | 50 ++++++---
qom/object.c | 250 ++++++++++++++++++++++---------------------
2 files changed, 164 insertions(+), 136 deletions(-)
+++ b/qom/object.c
@@ -1679,33 +1679,30 @@ static void object_finalize_child_property(Object *obj,
const char *name,
object_unref(child);
}
-void object_property_add_child(Object *obj, const char *name,
- Object *child, Error **errp)
+ObjectProperty *
+object_property_add_child(Object *obj, const char *name,
+ Object *child, Error **errp)
{
- Error *local_err = NULL;
- char *type;
+ g_autofree char *type = NULL;
I love how g_autofree simplifies things.
Reviewed-by: Eric Blake <ebl...@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org