X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=virt-what.in;h=e0fdf5bf2e17fbf1244d9189ef6f30a6d051e81d;hb=039a077e5531bc53703caf6474ed23573eae4d2b;hp=0979c50fbad340a1334d90e0321b37a6997e87d2;hpb=37f7b6e5f79d61ec4f8967f3de2ec63420aec894;p=virt-what.git diff --git a/virt-what.in b/virt-what.in index 0979c50..e0fdf5b 100644 --- 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. +# 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` @@ -100,8 +103,10 @@ if [ "$cpuid" = "Microsoft Hv" ]; then 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 @@ -143,10 +148,24 @@ if echo "$dmi" | grep -q 'Manufacturer.*HITACHI' && echo virtage fi -# Check for IBM SystemZ (z/VM, not tested whether this applies to Linux -# installed directly into an LPAR, we may need a separate test). +# Check for IBM SystemZ. if grep -q '^vendor_id.*IBM/S390' $root/proc/cpuinfo; then - echo zvm + echo ibm_systemz + if [ -f $root/proc/sysinfo ]; then + if grep -q 'VM.*Control Program.*z/VM' $root/proc/sysinfo; then + echo ibm_systemz-zvm + elif grep -q '^LPAR' $root/proc/sysinfo; then + echo ibm_systemz-lpar + else + # This is unlikely to be correct. + echo ibm_systemz-direct + fi + fi +fi + +# Check for Parallels. +if echo "$dmi" | grep -q 'Vendor: Parallels'; then + echo parallels fi # Check for Xen. @@ -162,11 +181,12 @@ elif [ -f $root/proc/xen/capabilities ]; then echo xen-domU fi is_xen=1 -elif [ -d $root/proc/xen ]; then - # This directory can be present when Xen paravirt drivers are - # installed, even on baremetal. Don't confuse people by - # printing anything. - : +elif [ -f $root/sys/hypervisor/type ] && + grep -q "xen" $root/sys/hypervisor/type; then + # Ordinary kernel with pv_ops. There does not seem to be + # enough information at present to tell whether this is dom0 + # or domU. XXX + echo xen fi # Check for QEMU/KVM.