aboutsummaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-10-01 10:59:57 +0200
committerMarkus Armbruster <armbru@redhat.com>2015-10-09 15:25:57 +0200
commitedb1523d90415cb79f60f83b4028ef3820d15612 (patch)
tree910ad84d6ffa93578fb093bcbe69a82158990fa0 /qmp.c
parent2d1abb850fd15fd6eb75a92290be5f93b2772ec5 (diff)
downloadqemu-edb1523d90415cb79f60f83b4028ef3820d15612.zip
qemu-edb1523d90415cb79f60f83b4028ef3820d15612.tar.gz
qemu-edb1523d90415cb79f60f83b4028ef3820d15612.tar.bz2
qmp: Fix device-list-properties not to crash for abstract device
Broken in commit f4eb32b "qmp: show QOM properties in device-list-properties", v2.1. Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Message-Id: <1443689999-12182-9-git-send-email-armbru@redhat.com>
Diffstat (limited to 'qmp.c')
-rw-r--r--qmp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/qmp.c b/qmp.c
index 057a7cb..1413de4 100644
--- a/qmp.c
+++ b/qmp.c
@@ -515,6 +515,12 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
return NULL;
}
+ if (object_class_is_abstract(klass)) {
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "name",
+ "non-abstract device type");
+ return NULL;
+ }
+
obj = object_new(typename);
QTAILQ_FOREACH(prop, &obj->properties, node) {