[libvirt] [PATCH v2 3/4] qemu: Fix probing of AMD SEV support

Peter Krempa pkrempa at redhat.com
Fri Aug 17 14:30:11 UTC 2018


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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180817/d7c6c19d/attachment-0001.sig>


More information about the libvir-list mailing list