X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=virt-what.in;h=d037a992f57a4154d89007f0b93538f41425639e;hb=d7fd8a7843030d2b1719353edfcd49dba3000122;hp=2011ff4d3f31c07acec3176543db94ae9cabf638;hpb=52870e8a264653d7921e8a4edff56d4b050614d8;p=virt-what.git diff --git a/virt-what.in b/virt-what.in index 2011ff4..d037a99 100644 --- a/virt-what.in +++ b/virt-what.in @@ -38,6 +38,13 @@ have_cpuinfo () { 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 @@ -304,6 +311,12 @@ if ! "$skip_qemu_kvm"; then # 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