qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 33/40] qmp: Fix device-list-properties not to crash


From: Michael Roth
Subject: [Qemu-devel] [PATCH 33/40] qmp: Fix device-list-properties not to crash for abstract device
Date: Wed, 21 Oct 2015 12:52:03 -0500

From: Markus Armbruster <address@hidden>

Broken in commit f4eb32b "qmp: show QOM properties in
device-list-properties", v2.1.

Cc: address@hidden
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
Message-Id: <address@hidden>
(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 <address@hidden>
---
 qmp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/qmp.c b/qmp.c
index 403805a..8603c46 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) {
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]