Blame SOURCES/0008-aws-Detect-AWS-from-dmidecode-information.patch

e10a2d
From 147c648e950ef45b7a5b7b3e8cb30b89c435593b Mon Sep 17 00:00:00 2001
e10a2d
From: "Richard W.M. Jones" <rjones@redhat.com>
e10a2d
Date: Wed, 31 Oct 2018 15:04:24 +0000
7c1897
Subject: [PATCH 08/22] aws: Detect AWS from dmidecode information.
e10a2d
e10a2d
Move the AWS detection out from under Xen.  AWS runs on KVM and
e10a2d
baremetal these days.  The dmidecode information for KVM and baremetal
e10a2d
is a little bit different so we also need to adjust the test for that
e10a2d
case.
e10a2d
e10a2d
Typical SMBIOS info for Xen:
e10a2d
e10a2d
BIOS Information
e10a2d
        Vendor: Xen
e10a2d
        Version: 4.2.amazon
e10a2d
e10a2d
Typical SMBIOS info for KVM and baremetal:
e10a2d
e10a2d
BIOS Information
e10a2d
        Vendor: Amazon EC2
e10a2d
        Version: 1.0
e10a2d
e10a2d
Thanks: Vitaly Kuznetsov, Jon Masters.
e10a2d
---
e10a2d
 virt-what.in  | 13 +++++++++----
e10a2d
 virt-what.pod |  8 ++++++--
e10a2d
 2 files changed, 15 insertions(+), 6 deletions(-)
e10a2d
e10a2d
diff --git a/virt-what.in b/virt-what.in
e10a2d
index a2f8f19..f685461 100644
e10a2d
--- a/virt-what.in
e10a2d
+++ b/virt-what.in
e10a2d
@@ -233,10 +233,6 @@ fi
e10a2d
 if [ "$cpuid" = "XenVMMXenVMM" ] &&
e10a2d
     ! echo "$dmi" | grep -q 'No SMBIOS nor DMI entry point found, sorry'; then
e10a2d
     echo xen; echo xen-hvm
e10a2d
-    # Check for AWS
e10a2d
-    if echo "$dmi" | grep -q 'Version: [0-9]\.[0-9]\.amazon'; then
e10a2d
-        echo aws
e10a2d
-    fi
e10a2d
     skip_qemu_kvm=true
e10a2d
 elif [ -d "${root}/proc/xen" ]; then
e10a2d
     echo xen
e10a2d
@@ -392,3 +388,12 @@ if [ "${arch#sparc}" != "$arch" ] && [ -e "${root}/dev/mdesc" ]; then
e10a2d
         fi
e10a2d
     fi
e10a2d
 fi
e10a2d
+
e10a2d
+# Check for AWS.
e10a2d
+# AWS on Xen.
e10a2d
+if echo "$dmi" | grep -q 'Version: [0-9]\.[0-9]\.amazon'; then
e10a2d
+    echo aws
e10a2d
+# AWS on baremetal or KVM.
e10a2d
+elif echo "$dmi" | grep -q 'Vendor: Amazon EC2'; then
e10a2d
+    echo aws
e10a2d
+fi
e10a2d
diff --git a/virt-what.pod b/virt-what.pod
e10a2d
index ebfc190..5a0bdfc 100644
e10a2d
--- a/virt-what.pod
e10a2d
+++ b/virt-what.pod
e10a2d
@@ -27,9 +27,13 @@ don't know about or cannot detect.
e10a2d
 
e10a2d
 =item B<aws>
e10a2d
 
e10a2d
-Amazon Web Services cloud guest.
e10a2d
+Amazon Web Services.
e10a2d
 
e10a2d
-Status: contributed by Qi Guo.
e10a2d
+Note that virt-what will print this fact for baremetal AWS instances,
e10a2d
+which you might not consider to be true virtualization.  In this case
e10a2d
+other facts (eg. C<kvm> or C<xen>) would I<not> be present.
e10a2d
+
e10a2d
+Status: contributed by Qi Guo, Vitaly Kuznetsov, confirmed by RWMJ.
e10a2d
 
e10a2d
 =item B<bhyve>
e10a2d
 
e10a2d
-- 
7c1897
2.32.0
e10a2d