]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix the check of AMD secure guest support
authorVasiliy Ulyanov <vulyanov@suse.de>
Fri, 19 Nov 2021 12:37:38 +0000 (13:37 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 19 Nov 2021 13:59:00 +0000 (14:59 +0100)
The content of /sys/module/kvm_amd/parameters/sev may vary depending on
the kernel version. Check also for 'Y' and 'y' in addition to '1' to
cover several possible variants. The fix is similar to the one
introduced in commit 3f9c1a4bb841

Signed-off-by: Vasiliy Ulyanov <vulyanov@suse.de>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_capabilities.c

index 67fae46a34c019eb2b26b1b5ca406160297fb846..b864f4d7df64d8f8e46d3c521e30360fa529710d 100644 (file)
@@ -4681,7 +4681,7 @@ virQEMUCapsKVMSupportsSecureGuestAMD(void)
     if (virFileReadValueString(&modValue, "/sys/module/kvm_amd/parameters/sev") < 0)
         return false;
 
-    if (modValue[0] != '1')
+    if (modValue[0] != '1' && modValue[0] != 'Y' && modValue[0] != 'y')
         return false;
 
     if (virFileExists(QEMU_DEV_SEV))