提交 730af8f2 编写于 作者: M Michal Privoznik

qemuMonitorJSONGetCPUx86Data: Don't fail on ancient qemus

On the domain startup, this function is called to dump some info about
the CPUs. At the beginning of the function we check if we aren't running
older qemu which is not exposing the CPUs via 'qom-list'. However, we
are not checking for even older qemus, which throw 'CommandNotFound'
error.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 8229e33a
...@@ -5528,11 +5528,13 @@ qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon, ...@@ -5528,11 +5528,13 @@ qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon,
goto cleanup; goto cleanup;
/* check if device exists */ /* check if device exists */
if ((data = virJSONValueObjectGet(reply, "error")) && if ((data = virJSONValueObjectGet(reply, "error"))) {
STREQ_NULLABLE(virJSONValueObjectGetString(data, "class"), const char *klass = virJSONValueObjectGetString(data, "class");
"DeviceNotFound")) { if (STREQ_NULLABLE(klass, "DeviceNotFound") ||
ret = -2; STREQ_NULLABLE(klass, "CommandNotFound")) {
goto cleanup; ret = -2;
goto cleanup;
}
} }
if (qemuMonitorJSONCheckError(cmd, reply)) if (qemuMonitorJSONCheckError(cmd, reply))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册