qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 05/17] qom: Make all the object_property_add_FOO() return the


From: Eric Blake
Subject: Re: [PATCH 05/17] qom: Make all the object_property_add_FOO() return the property
Date: Tue, 28 Apr 2020 12:51:39 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

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 <address@hidden>
---
  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 <address@hidden>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]