[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/2] Check for unsupported QMP command



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 <stefanb 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]