git.annexia.org
/
virt-what.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a regression test for IBM PowerVM Lx86 emulator (thanks Yufang Zhang).
[virt-what.git]
/
virt-what.in
diff --git
a/virt-what.in
b/virt-what.in
index
a0f7406
..
e0fdf5b
100644
(file)
--- a/
virt-what.in
+++ b/
virt-what.in
@@
-81,6
+81,9
@@
fi
cpuid=`virt-what-cpuid-helper`
# Check for various products in the BIOS information.
cpuid=`virt-what-cpuid-helper`
# Check for various products in the BIOS information.
+# Note that dmidecode doesn't exist on non-PC architectures. On these,
+# this will return an error which is ignored (error message redirected
+# into $dmi variable).
dmi=`LANG=C dmidecode 2>&1`
dmi=`LANG=C dmidecode 2>&1`
@@
-100,8
+103,10
@@
if [ "$cpuid" = "Microsoft Hv" ]; then
fi
# Check for VirtualPC.
fi
# Check for VirtualPC.
-
-if echo "$dmi" | grep -q 'Manufacturer: Microsoft Corporation'; then
+# The negative check for cpuid is to distinguish this from Hyper-V
+# which also has the same manufacturer string in the SM-BIOS data.
+if [ "$cpuid" != "Microsoft Hv" ] &&
+ echo "$dmi" | grep -q 'Manufacturer: Microsoft Corporation'; then
echo virtualpc
fi
echo virtualpc
fi