aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-06-09 10:48:39 -0600
committerMarkus Armbruster <armbru@redhat.com>2016-07-06 10:52:04 +0200
commite7ca56562990991bc614a43b9351ee0737f3045d (patch)
tree578db0dfd0af98fdf0634cf5ca5d6dba680d7b7f /qom
parentb70ce1018a251c0c33498d9c927a07cade655a5e (diff)
string-output-visitor: Favor new visit_free() function
Now that we have a polymorphic visit_free(), we no longer need string_output_visitor_cleanup(); however, we still need to expose the subtype for string_output_get_string(). Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1465490926-28625-9-git-send-email-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/qom/object.c b/qom/object.c
index 02c0a3a98f..2407b667d9 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1242,14 +1242,15 @@ int object_property_get_enum(Object *obj, const char *name,
enumprop = prop->opaque;
sov = string_output_visitor_new(false);
- object_property_get(obj, string_output_get_visitor(sov), name, &err);
+ v = string_output_get_visitor(sov);
+ object_property_get(obj, v, name, &err);
if (err) {
error_propagate(errp, err);
- string_output_visitor_cleanup(sov);
+ visit_free(v);
return 0;
}
str = string_output_get_string(sov);
- string_output_visitor_cleanup(sov);
+ visit_free(v);
v = string_input_visitor_new(str);
visit_type_enum(v, name, &ret, enumprop->strings, errp);
@@ -1281,7 +1282,7 @@ void object_property_get_uint16List(Object *obj, const char *name,
g_free(str);
visit_free(v);
out:
- string_output_visitor_cleanup(ov);
+ visit_free(string_output_get_visitor(ov));
}
void object_property_parse(Object *obj, const char *string,
@@ -1309,7 +1310,7 @@ char *object_property_print(Object *obj, const char *name, bool human,
string = string_output_get_string(sov);
out:
- string_output_visitor_cleanup(sov);
+ visit_free(string_output_get_visitor(sov));
return string;
}