From: Xiao Liang Date: Tue, 24 May 2022 09:34:52 +0000 (+0800) Subject: detect AWS arm virtual instance as kvm X-Git-Tag: v1.25~1 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=39001e7c458d798225814c04e920583fa7e2a41c;p=virt-what.git detect AWS arm virtual instance as kvm AWS arm virtual instance is KVM based hypervisor. With this patch: $ sudo virt-what kvm aws $ cat /sys/devices/virtual/dmi/id/product_name t4g.small Without it: $ sudo virt-what aws Signed-off-by: Xiao Liang --- diff --git a/tests/aws-kvm-arm/test.sh b/tests/aws-kvm-arm/test.sh index 5d31995..133ef13 100755 --- a/tests/aws-kvm-arm/test.sh +++ b/tests/aws-kvm-arm/test.sh @@ -16,9 +16,8 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. output="$(PATH=../..:$PATH virt-what --test-root=. 2>&1)" -# XXX At the moment KVM cannot be detected on this platform. -# We hope to fix that, but for now the only fact printed is "aws". -expected="aws" +expected="kvm +aws" if [ "$output" != "$expected" ]; then echo "$0: test failed because output did not match expected" diff --git a/virt-what.in b/virt-what.in index 4f05074..d090898 100644 --- a/virt-what.in +++ b/virt-what.in @@ -329,6 +329,11 @@ if ! "$skip_qemu_kvm"; then elif echo "$dmi" | grep -q 'Manufacturer: KVM'; then echo kvm skip_lkvm=true + elif echo "$dmi" | grep -q 'Manufacturer: Amazon EC2' && + echo "$dmi" | grep -q 'System is a virtual machine'; then + # This is for AWS Graviton (Arm) systems which don't have CPUID. + echo kvm + skip_lkvm=true elif echo "$dmi" | grep -q 'Manufacturer: QEMU'; then # The test for KVM above failed, so now we know we're # not using KVM acceleration.