From: Markus Armbruster Date: Thu, 1 Oct 2015 08:59:57 +0000 (+0200) Subject: qmp: Fix device-list-properties not to crash for abstract device X-Git-Tag: qemu-xen-4.7.0-rc1~79 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2d0583fc79ab119def5cfd38b1c695654e332cf2;p=qemu-xen.git 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 Reviewed-by: Eric Blake Reviewed-by: Andreas Färber 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 --- diff --git a/qmp.c b/qmp.c index 403805a551..8603c46bdb 100644 --- a/qmp.c +++ b/qmp.c @@ -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) {