diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-10-01 10:59:57 +0200 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2015-10-21 10:46:48 -0500 |
commit | 2d0583fc79ab119def5cfd38b1c695654e332cf2 (patch) | |
tree | 43806adc832aee0686e5fea1e0a99661b2c84150 | |
parent | 40161bf27b6f0143062f588b496f0a66b6ec769b (diff) | |
download | qemu-2d0583fc79ab119def5cfd38b1c695654e332cf2.tar.gz |
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>
(cherry picked from commit edb1523d90415cb79f60f83b4028ef3820d15612)
Conflicts:
tests/device-introspect-test.c
* removed hunk specific to QAPI introspection (not in 2.4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | qmp.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -514,6 +514,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) { |