Check for an unsupported QMP command when using the query-tpm-models
and query-tpm-types commands before checking for general errors
in order to avoid error messages in the log.

Signed-off-by: Stefan Berger <stef...@linux.vnet.ibm.com>

---
 src/qemu/qemu_monitor_json.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: libvirt/src/qemu/qemu_monitor_json.c
===================================================================
--- libvirt.orig/src/qemu/qemu_monitor_json.c
+++ libvirt/src/qemu/qemu_monitor_json.c
@@ -4774,8 +4774,12 @@ qemuMonitorJSONGetStringArray(qemuMonito
 
     ret = qemuMonitorJSONCommand(mon, cmd, &reply);
 
-    if (ret == 0)
+    if (ret == 0) {
+        if (qemuMonitorJSONHasError(reply, "CommandNotFound"))
+            goto cleanup;
+
         ret = qemuMonitorJSONCheckError(cmd, reply);
+    }
 
     if (ret < 0)
         goto cleanup;

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to