summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2017-07-14 10:14:53 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2017-07-14 12:04:42 +0200
commit75ab905383ea92d1c44cdd07e0f9fd509d51c9cc (patch)
tree5a94c6899376b052df711d466eb35a196ea95ea2
parent5b4ff3c661374b2df247e12b58667e4643b30af1 (diff)
downloadfocaccia-qemu-75ab905383ea92d1c44cdd07e0f9fd509d51c9cc.tar.gz
focaccia-qemu-75ab905383ea92d1c44cdd07e0f9fd509d51c9cc.zip
qmp: Use ObjectProperty.type if present
The dynamic value is more informative in the case of link property,
otherwise it is the same.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170714021509.23681-5-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--qmp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/qmp.c b/qmp.c
index e6b68fe798..2cd40c3080 100644
--- a/qmp.c
+++ b/qmp.c
@@ -486,7 +486,8 @@ static DevicePropertyInfo *make_device_property_info(ObjectClass *klass,
 
             info = g_malloc0(sizeof(*info));
             info->name = g_strdup(prop->name);
-            info->type = g_strdup(prop->info->name);
+            info->type = default_type ? g_strdup(default_type)
+                                      : g_strdup(prop->info->name);
             info->has_description = !!prop->info->description;
             info->description = g_strdup(prop->info->description);
             return info;