Fix virt-what-cpuid-helper.
[virt-what.git] / virt-what.in
index d037a99..f685461 100644 (file)
@@ -42,7 +42,7 @@ use_sysctl() {
     # Lacking /proc, on some systems sysctl can be used instead.
     OS=$(uname) || fail "failed to get operating system name"
 
-    [ "$OS" == "OpenBSD" ]
+    [ "$OS" = "OpenBSD" ]
 }
 
 fail () {
@@ -233,10 +233,6 @@ fi
 if [ "$cpuid" = "XenVMMXenVMM" ] &&
     ! echo "$dmi" | grep -q 'No SMBIOS nor DMI entry point found, sorry'; then
     echo xen; echo xen-hvm
-    # Check for AWS
-    if echo "$dmi" | grep -q 'Version: [0-9]\.[0-9]\.amazon'; then
-        echo aws
-    fi
     skip_qemu_kvm=true
 elif [ -d "${root}/proc/xen" ]; then
     echo xen
@@ -392,3 +388,12 @@ if [ "${arch#sparc}" != "$arch" ] && [ -e "${root}/dev/mdesc" ]; then
         fi
     fi
 fi
+
+# Check for AWS.
+# AWS on Xen.
+if echo "$dmi" | grep -q 'Version: [0-9]\.[0-9]\.amazon'; then
+    echo aws
+# AWS on baremetal or KVM.
+elif echo "$dmi" | grep -q 'Vendor: Amazon EC2'; then
+    echo aws
+fi