test -e "${root}/proc/cpuinfo"
}
+use_sysctl() {
+ # Lacking /proc, on some systems sysctl can be used instead.
+ OS=$(uname) || fail "failed to get operating system name"
+
+ [ "$OS" == "OpenBSD" ]
+}
+
fail () {
echo "virt-what: $1" >&2
exit 1
# We are running as a spapr KVM guest on ppc64
echo kvm
skip_lkvm=true
+ elif use_sysctl; then
+ # SmartOS KVM
+ product=$(sysctl -n hw.product)
+ if echo "$product" | grep -q 'SmartDC HVM'; then
+ echo kvm
+ fi
else
# This is known to fail for qemu with the explicit -cpu
# option, since /proc/cpuinfo will not contain the QEMU