qemu_monitor: allow cpu props to be optional

Some older s390 CPU models (e.g. z900) will not report props as a
response from query-cpu-model-expansion. As such, we should make the
props field optional when parsing the return data from the QMP response.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Message-Id: <1568924706-2311-6-git-send-email-walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Collin Walling
2019-10-07 10:09:49 +02:00
committed by Jiri Denemark
parent 708f48525a
commit afd222684e
6 changed files with 35 additions and 13 deletions
+5 -1
View File
@@ -482,6 +482,7 @@ cpuTestMakeQEMUCaps(const struct data *data)
qemuMonitorTestPtr testMon = NULL;
qemuMonitorCPUModelInfoPtr model = NULL;
virCPUDefPtr cpu = NULL;
bool fail_no_props = true;
char *json = NULL;
if (virAsprintf(&json, "%s/cputestdata/%s-cpuid-%s.json",
@@ -494,9 +495,12 @@ cpuTestMakeQEMUCaps(const struct data *data)
if (VIR_ALLOC(cpu) < 0 || VIR_STRDUP(cpu->model, "host") < 0)
goto cleanup;
if (ARCH_IS_S390(data->arch))
fail_no_props = false;
if (qemuMonitorGetCPUModelExpansion(qemuMonitorTestGetMonitor(testMon),
QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC,
cpu, true, &model) < 0)
cpu, true, fail_no_props, &model) < 0)
goto error;
if (!(qemuCaps = virQEMUCapsNew()))