
On Fri, Aug 17, 2018 at 04:30:11PM +0200, Peter Krempa wrote:
On Thu, Aug 16, 2018 at 12:35:17 +0200, Erik Skultety wrote:
So the procedure to detect SEV support works like this: 1) we detect that sev-guest is among the QOM types and set the cap flag 2) we probe the monitor for SEV support - this is tricky, because QEMU with compiled SEV support will always report -object sev-guest and query-sev-capabilities command, that however doesn't mean SEV is supported 3) depending on what the monitor returned, we either keep or clear the capability flag for SEV
Commit a349c6c21c6 added an explicit check for "GenericError" in the monitor reply to prevent libvirtd to spam logs about missing 'query-sev-capabilities' command. At the same time though, it returned success in this case which means that we didn't clear the capability flag afterwards and happily formatted SEV into qemuCaps. Therefore, adjust all the relevant callers to handle -1 on errors, 0 on SEV being unsupported and 1 on SEV being supported.
Signed-off-by: Erik Skultety <eskultet@redhat.com> --- src/qemu/qemu_capabilities.c | 15 +++++++++++---- src/qemu/qemu_monitor_json.c | 20 ++++++++++++++++---- tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 - 3 files changed, 27 insertions(+), 9 deletions(-)
ACK
Thanks, I pushed the series. Erik