]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: ignore query-sev-capabilities errors
authorJán Tomko <jtomko@redhat.com>
Thu, 14 Jun 2018 07:30:27 +0000 (09:30 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 14 Jun 2018 08:51:29 +0000 (10:51 +0200)
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 <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/qemu/qemu_monitor_json.c

index c5480a2d0ec27e6640a3ee31f02c73fa45a51944..aa89ea7056928988d2785a0e189cc66fba4294d9 100644 (file)
@@ -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;