From 98a6528461acf7a6f321d846e6f4e77e87305965 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sat, 8 Feb 2014 11:01:49 +0100 Subject: qdev: Inline qdev_prop_parse() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Igor Mammedov Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini Signed-off-by: Andreas Färber --- qdev-monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qdev-monitor.c') diff --git a/qdev-monitor.c b/qdev-monitor.c index 1d3b68d40a..4d1634cd5f 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -145,7 +145,7 @@ static void qdev_print_devinfos(bool show_no_user) static int set_property(const char *name, const char *value, void *opaque) { - DeviceState *dev = opaque; + Object *obj = opaque; Error *err = NULL; if (strcmp(name, "driver") == 0) @@ -153,7 +153,7 @@ static int set_property(const char *name, const char *value, void *opaque) if (strcmp(name, "bus") == 0) return 0; - qdev_prop_parse(dev, name, value, &err); + object_property_parse(obj, value, name, &err); if (err != NULL) { qerror_report_err(err); error_free(err); -- cgit v1.2.3 From 0b7593e085e66c7f5ab980a1ed8ee683c36b7347 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sat, 8 Feb 2014 11:01:50 +0100 Subject: qapi: Add human mode to StringOutputVisitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini Signed-off-by: Andreas Färber --- qdev-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qdev-monitor.c') diff --git a/qdev-monitor.c b/qdev-monitor.c index 4d1634cd5f..f385fb32a3 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -577,7 +577,7 @@ static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props, if (object_property_get_type(OBJECT(dev), legacy_name, NULL)) { value = object_property_get_str(OBJECT(dev), legacy_name, &err); } else { - value = object_property_print(OBJECT(dev), props->name, &err); + value = object_property_print(OBJECT(dev), props->name, false, &err); } g_free(legacy_name); -- cgit v1.2.3 From dae3bda422340901742e4db6b471d3084dfdc84d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sat, 8 Feb 2014 11:01:51 +0100 Subject: qdev: Use human mode in "info qtree" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Igor Mammedov Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini Signed-off-by: Andreas Färber --- qdev-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qdev-monitor.c') diff --git a/qdev-monitor.c b/qdev-monitor.c index f385fb32a3..b37778f0f3 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -577,7 +577,7 @@ static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props, if (object_property_get_type(OBJECT(dev), legacy_name, NULL)) { value = object_property_get_str(OBJECT(dev), legacy_name, &err); } else { - value = object_property_print(OBJECT(dev), props->name, false, &err); + value = object_property_print(OBJECT(dev), props->name, true, &err); } g_free(legacy_name); -- cgit v1.2.3