New subject: [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(a)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;
On Tue, Apr 16, 2013 at 06:37:07AM -0400, Stefan Berger wrote:
> Properly suppress log messages when using unsupported TPM QMP commands.
ACK to both.
Daniel