diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e716fb3763b7db7d568982ed80d4f1efd8234119..ec3b95876dd567879116db96902de601a454f079 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5528,11 +5528,13 @@ qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon, goto cleanup; /* check if device exists */ - if ((data = virJSONValueObjectGet(reply, "error")) && - STREQ_NULLABLE(virJSONValueObjectGetString(data, "class"), - "DeviceNotFound")) { - ret = -2; - goto cleanup; + if ((data = virJSONValueObjectGet(reply, "error"))) { + const char *klass = virJSONValueObjectGetString(data, "class"); + if (STREQ_NULLABLE(klass, "DeviceNotFound") || + STREQ_NULLABLE(klass, "CommandNotFound")) { + ret = -2; + goto cleanup; + } } if (qemuMonitorJSONCheckError(cmd, reply))