google-cloud: Print "kvm" fact on aarch64 instances
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 8 Aug 2022 16:13:11 +0000 (12:13 -0400)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 8 Aug 2022 16:17:29 +0000 (12:17 -0400)
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
virt-what.in

index 39287a2..8cc69c5 100755 (executable)
@@ -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"
index ad82e22..4f05074 100644 (file)
@@ -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.