From da3568b25a582603ba15690793c8867cc7c5d2a8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 8 Aug 2022 12:13:11 -0400 Subject: [PATCH 1/1] google-cloud: Print "kvm" fact on aarch64 instances GCE instances are KVM with a non-QEMU userspace. On x86-64 we should recognize this from the CPUID information, but aarch64 has no equivalent to this. /proc/device-tree/hypervisor/compatible contains something but RHEL does not use device tree. However the SMBIOS tables exported by GCE do contain: Manufacturer: KVM so we can use that. # uname -m aarch64 # virt-what google_cloud kvm This commit also updates the test. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2114997 Updates: commit 54b726fa7c9687b692162488e8934a426f9fa6c3 Thanks: Eric Auger, Yongkui Guo --- tests/google-cloud/test.sh | 3 ++- virt-what.in | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/google-cloud/test.sh b/tests/google-cloud/test.sh index 39287a2..8cc69c5 100755 --- a/tests/google-cloud/test.sh +++ b/tests/google-cloud/test.sh @@ -16,7 +16,8 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. output="$(PATH=../..:$PATH virt-what --test-root=. 2>&1)" -expected="google_cloud" +expected="google_cloud +kvm" 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 ad82e22..4f05074 100644 --- a/virt-what.in +++ b/virt-what.in @@ -326,6 +326,9 @@ if ! "$skip_qemu_kvm"; then elif echo "$dmi" | grep -q 'Product Name: KVM'; then echo kvm skip_lkvm=true + elif echo "$dmi" | grep -q 'Manufacturer: KVM'; then + 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. -- 1.8.3.1