git.annexia.org
/
virt-what.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f45fd9
)
virt-what.in: warn about missing cpuid-virt helper program
author
Assaf Gordon
<assafgordon@gmail.com>
Mon, 15 Sep 2014 19:08:20 +0000
(19:08 +0000)
committer
Richard W.M. Jones
<rjones@redhat.com>
Mon, 31 Oct 2016 10:14:50 +0000
(06:14 -0400)
Try to find the binary program on the $PATH, and give informative error
message if it wasn't found.
(cherry picked from commit
e3e88af8847a4269fb275fd054fc36c5066d5d49
)
virt-what.in
patch
|
blob
|
history
diff --git
a/virt-what.in
b/virt-what.in
index
3feeb60
..
5ae1ccb
100644
(file)
--- a/
virt-what.in
+++ b/
virt-what.in
@@
-80,6
+80,12
@@
if [ "x$root" = "x" ] && [ "$EFFUID" -ne 0 ]; then
fail "this script must be run as root"
fi
+# Try to locate the CPU-ID helper program
+CPUID_HELPER=$(which virt-what-cpuid-helper 2>/dev/null)
+if [ -z "$CPUID_HELPER" ] ; then
+ fail "virt-what-cpuid-helper program not found in \$PATH"
+fi
+
# Many fullvirt hypervisors give an indication through CPUID. Use the
# helper program to get this information.