aboutsummaryrefslogtreecommitdiff
path: root/qom/object.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-02-08 11:01:50 +0100
committerAndreas Färber <afaerber@suse.de>2014-02-14 21:12:03 +0100
commit0b7593e085e66c7f5ab980a1ed8ee683c36b7347 (patch)
treef883f5fc027994008c1e5a214d5b36100c7ad1ee /qom/object.c
parent98a6528461acf7a6f321d846e6f4e77e87305965 (diff)
qapi: Add human mode to StringOutputVisitor
This will be used by "info qtree". For numbers it prints both the decimal and hex values. For sizes it rounds to the nearest power of 2^10. For strings, it puts quotes around the string and separates NULL and empty string. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qom/object.c b/qom/object.c
index 62e7e415d9..660859c0e7 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -948,13 +948,13 @@ void object_property_parse(Object *obj, const char *string,
string_input_visitor_cleanup(mi);
}
-char *object_property_print(Object *obj, const char *name,
+char *object_property_print(Object *obj, const char *name, bool human,
Error **errp)
{
StringOutputVisitor *mo;
char *string;
- mo = string_output_visitor_new();
+ mo = string_output_visitor_new(human);
object_property_get(obj, string_output_get_visitor(mo), name, errp);
string = string_output_get_string(mo);
string_output_visitor_cleanup(mo);