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

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