From: Thomas Huth Date: Thu, 29 Jun 2017 10:27:42 +0000 (+0100) Subject: Detect KVM property when running on POWER (RHBZ#1455676). X-Git-Tag: v1.16~8 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=50153230d19401fe47fcfd19d7ca0a2623c1ff09;p=virt-what.git Detect KVM property when running on POWER (RHBZ#1455676). QEMU on ppc64 adds an additional property in the device tree if running with KVM, so you could check that property for the string "linux,kvm" to see if KVM is enabled: 0000000: 6c69 6e75 782c 6b76 6d00 linux,kvm. --- diff --git a/virt-what.in b/virt-what.in index 1a373ed..39afedb 100644 --- a/virt-what.in +++ b/virt-what.in @@ -288,6 +288,11 @@ if ! "$skip_qemu_kvm"; then echo qemu skip_lkvm=true fi + elif [ -d /proc/device-tree/hypervisor ] && + grep -q "linux,kvm" /proc/device-tree/hypervisor/compatible; then + # We are running as a spapr KVM guest on ppc64 + echo kvm + skip_lkvm=true else # XXX This is known to fail for qemu with the explicit -cpu # option, since /proc/cpuinfo will not contain the QEMU