]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Ignore non-boolean CPU model properties
authorJiri Denemark <jdenemar@redhat.com>
Wed, 11 Jan 2017 13:35:52 +0000 (14:35 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 12 Jan 2017 10:58:25 +0000 (11:58 +0100)
The query-cpu-model-expansion is currently implemented for s390(x) only
and all CPU properties it returns are booleans. However, x86
implementation will report more types of properties. Without making the
code more tolerant older libvirt would fail to probe newer QEMU
versions.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_monitor_json.c

index 9b9c098dc4b6c4105b45c27623276ae7fab859e9..3afd56f3860341a14550a1a29720300940be94c3 100644 (file)
@@ -4982,15 +4982,12 @@ qemuMonitorJSONParseCPUModelProperty(const char *key,
     size_t n = machine_model->nprops;
     bool supported;
 
+    if (virJSONValueGetBoolean(value, &supported) < 0)
+        return 0;
+
     if (VIR_STRDUP(machine_model->props[n].name, key) < 0)
         return -1;
 
-    if (virJSONValueGetBoolean(value, &supported) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("query-cpu-model-expansion reply data is missing a"
-                         " feature support value"));
-        return -1;
-    }
     machine_model->props[n].supported = supported;
 
     machine_model->nprops++;