# Check for Parallels.
if echo "$dmi" | grep -q 'Vendor: Parallels'; then
echo parallels
+ skip_qemu_kvm=1
fi
# Check for Xen.
if [ "$cpuid" = "XenVMMXenVMM" ]; then
echo xen; echo xen-hvm
- is_xen=1
+ skip_qemu_kvm=1
elif [ -f $root/proc/xen/capabilities ]; then
echo xen
if grep -q "control_d" $root/proc/xen/capabilities; then
else
echo xen-domU
fi
- is_xen=1
+ skip_qemu_kvm=1
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
fi
# Check for QEMU/KVM.
+#
+# Parallels exports KVMKVMKVM leaf, so skip this test if we've already
+# seen that it's Parallels. Xen uses QEMU as the device model, so
+# skip this test if we know it is Xen.
-if [ ! "$is_xen" ]; then
- # Disable this test if we know this is Xen already, because Xen
- # uses QEMU for its device model.
-
- if grep -q 'QEMU' $root/proc/cpuinfo; then
- if [ "$cpuid" = "KVMKVMKVM" ]; then
- echo kvm
- else
+if [ ! "$skip_qemu_kvm" ]; then
+ if [ "$cpuid" = "KVMKVMKVM" ]; then
+ echo kvm
+ else
+ # XXX This is known to fail for qemu with the explicit -cpu
+ # option, since /proc/cpuinfo will not contain the QEMU
+ # string. The long term fix for this would be to export
+ # another CPUID leaf for non-accelerated qemu.
+ if grep -q 'QEMU' $root/proc/cpuinfo; then
echo qemu
fi
fi