X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=virt-what.in;h=74ffab2cb57ccfafcfbb3629f4226832b9ec94d8;hb=3ea952163f0c28cd88f8473bb015df892c4247bf;hp=a27be106de3ca56cf9862597a8ec870bb328f090;hpb=441ce9d9ecf9edf0f325c280451ba69dc160882e;p=virt-what.git diff --git a/virt-what.in b/virt-what.in index a27be10..74ffab2 100644 --- a/virt-what.in +++ b/virt-what.in @@ -87,6 +87,11 @@ cpuid=`virt-what-cpuid-helper` dmi=`LANG=C dmidecode 2>&1` +# Architecture. +# Note for the purpose of testing, we only call uname with -p option. + +arch=`uname -p` + # Check for VMware. # cpuid check added by Chetan Loke. @@ -188,6 +193,22 @@ elif [ -f $root/sys/hypervisor/type ] && # enough information at present to tell whether this is dom0 # or domU. XXX echo xen +elif [ "$arch" = "ia64" ]; then + if [ -d $root/sys/bus/xen -a ! -d $root/sys/bus/xen-backend ]; then + # PV-on-HVM drivers installed in a Xen guest. + echo xen + echo xen-domU + else + # There is no virt leaf on IA64 HVM. This is a last-ditch + # attempt to detect something is virtualized by using a + # timing attack. + virt-what-ia64-xen-rdtsc-test > /dev/null 2>&1 + case "$?" in + 0) ;; # not virtual + 1) # Could be some sort of virt, or could just be a bit slow. + echo virt + esac + fi fi # Check for QEMU/KVM.