Blame SOURCES/0010-virt-what.in-warn-about-missing-cpuid-virt-helper-pr.patch

f83e65
From d3908f46427a9126742a70967cf787edfd37ab43 Mon Sep 17 00:00:00 2001
b6cf65
From: Assaf Gordon <assafgordon@gmail.com>
b6cf65
Date: Mon, 15 Sep 2014 19:08:20 +0000
f83e65
Subject: [PATCH 10/26] virt-what.in: warn about missing cpuid-virt helper
b6cf65
 program
b6cf65
b6cf65
Try to find the binary program on the $PATH, and give informative error
b6cf65
message if it wasn't found.
b6cf65
---
b6cf65
 virt-what.in | 6 ++++++
b6cf65
 1 file changed, 6 insertions(+)
b6cf65
b6cf65
diff --git a/virt-what.in b/virt-what.in
b6cf65
index 3feeb60..5ae1ccb 100644
b6cf65
--- a/virt-what.in
b6cf65
+++ b/virt-what.in
b6cf65
@@ -80,6 +80,12 @@ if [ "x$root" = "x" ] && [ "$EFFUID" -ne 0 ]; then
b6cf65
     fail "this script must be run as root"
b6cf65
 fi
b6cf65
 
b6cf65
+# Try to locate the CPU-ID helper program
b6cf65
+CPUID_HELPER=$(which virt-what-cpuid-helper 2>/dev/null)
b6cf65
+if [ -z "$CPUID_HELPER" ] ; then
b6cf65
+    fail "virt-what-cpuid-helper program not found in \$PATH"
b6cf65
+fi
b6cf65
+
b6cf65
 # Many fullvirt hypervisors give an indication through CPUID.  Use the
b6cf65
 # helper program to get this information.
b6cf65
 
b6cf65
-- 
f83e65
1.8.3.1
b6cf65