From a349c6c21c67ccf4574dcce0669746031d99f603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Thu, 14 Jun 2018 09:30:27 +0200 Subject: [PATCH] qemu: ignore query-sev-capabilities errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The query-sev-capabilities command fails if SEV is not compiled in, even though both the command and -object sev-guest are present in that case :/ Ignore the errors to avoid spamming the logs: internal error: unable to execute QEMU command 'query-sev-capabilities': SEV feature is not available Signed-off-by: Ján Tomko Reviewed-by: Daniel P. Berrangé Reviewed-by: Andrea Bolognani --- src/qemu/qemu_monitor_json.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index c5480a2d0e..aa89ea7056 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6423,6 +6423,12 @@ qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon, if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) goto cleanup; + /* Both -object sev-guest and query-sev-capabilities can be present + * even if SEV is not available */ + if (qemuMonitorJSONHasError(reply, "GenericError")) { + ret = 0; + goto cleanup; + } if (qemuMonitorJSONCheckError(cmd, reply) < 0) goto cleanup; -- GitLab