summaryrefslogtreecommitdiffstats
path: root/sys-utils/lscpu.c
diff options
context:
space:
mode:
authorKarel Zak2015-02-06 11:23:40 +0100
committerKarel Zak2015-02-06 11:23:40 +0100
commit79738105b1d31115b7e9f85351e074ef250f31b7 (patch)
treeee35aa6f9ceacfe951bab76d62cc7d22c86d6f5d /sys-utils/lscpu.c
parentlibfdisk: fix compiler warning (diff)
downloadkernel-qcow2-util-linux-79738105b1d31115b7e9f85351e074ef250f31b7.tar.gz
kernel-qcow2-util-linux-79738105b1d31115b7e9f85351e074ef250f31b7.tar.xz
kernel-qcow2-util-linux-79738105b1d31115b7e9f85351e074ef250f31b7.zip
lscpu: cleanup ppc virtualization detection
References: https://bugzilla.redhat.com/show_bug.cgi?id=1151604 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/lscpu.c')
-rw-r--r--sys-utils/lscpu.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 2a616e2ad..aeec37c0b 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -623,22 +623,19 @@ read_hypervisor_powerpc(struct lscpu_desc *desc)
{
assert(!desc->hyper);
- /* powerpc:
- * IBM iSeries: legacy, if /proc/iSeries exists, its para-virtualized on top of OS/400
- * IBM pSeries: always has a hypervisor
- * if partition-name is "full", its kind of "bare-metal": full-system-partition
- * otherwise its some partition created by Hardware Management Console
- * in any case, its always some sort of HVM
- *
- * Note that pSeries could also be emulated by qemu and it's
- * indicated by 'qemu,pseries" in /compatible
- *
- * KVM: "linux,kvm" in /hypervisor/compatible indicates a KVM guest
- * Xen: not in use, not detected
- */
+ /* IBM iSeries: legacy, para-virtualized on top of OS/400 */
if (path_exist("/proc/iSeries")) {
desc->hyper = HYPER_OS400;
desc->virtype = VIRT_PARA;
+
+ /* PowerNV (POWER Non-Virtualized, bare-metal) */
+ } else if (path_exist(_PATH_PROC_DEVICETREE "/compatible")) {
+ if (is_compatible(_PATH_PROC_DEVICETREE "/compatible", "ibm,powernv")) {
+ desc->hyper = HYPER_KVM;
+ desc->virtype = VIRT_PARA;
+ }
+
+ /* PowerVM (IBM's proprietary hypervisor, aka pHyp */
} else if (path_exist(_PATH_PROC_DEVICETREE "/ibm,partition-name")
&& path_exist(_PATH_PROC_DEVICETREE "/hmc-managed?")
&& !path_exist(_PATH_PROC_DEVICETREE "/chosen/qemu,graphic-width")) {
@@ -652,16 +649,12 @@ read_hypervisor_powerpc(struct lscpu_desc *desc)
desc->virtype = VIRT_NONE;
fclose(fd);
}
- } else if (path_exist(_PATH_PROC_DEVICETREE "/hypervisor/compatible")) {
- if (is_compatible(_PATH_PROC_DEVICETREE "/hypervisor/compatible",
- "linux,kvm")) {
- desc->hyper = HYPER_KVM;
- desc->virtype = VIRT_FULL;
- }
+
+ /* Qemu */
} else if (path_exist(_PATH_PROC_DEVICETREE "/compatible")) {
if (is_compatible(_PATH_PROC_DEVICETREE "/compatible", "qemu,pseries")) {
desc->hyper = HYPER_KVM;
- desc->virtype = VIRT_FULL;
+ desc->virtype = VIRT_PARA;
}
}
return desc->hyper;