diff options
-rw-r--r-- | man/systemd-detect-virt.xml | 7 | ||||
-rw-r--r-- | man/systemd.unit.xml | 1 | ||||
-rw-r--r-- | src/basic/virt.c | 6 | ||||
-rw-r--r-- | src/basic/virt.h | 1 |
4 files changed, 14 insertions, 1 deletions
diff --git a/man/systemd-detect-virt.xml b/man/systemd-detect-virt.xml index 9c66fa7afa..36c4602d69 100644 --- a/man/systemd-detect-virt.xml +++ b/man/systemd-detect-virt.xml @@ -62,7 +62,7 @@ </thead> <tbody> <row> - <entry valign="top" morerows="12">VM</entry> + <entry valign="top" morerows="13">VM</entry> <entry><varname>qemu</varname></entry> <entry>QEMU software virtualization, without KVM</entry> </row> @@ -93,6 +93,11 @@ </row> <row> + <entry><varname>powervm</varname></entry> + <entry>IBM PowerVM hypervisor - comes as firmware with some IBM POWER servers</entry> + </row> + + <row> <entry><varname>xen</varname></entry> <entry>Xen hypervisor (only domU, not dom0)</entry> </row> diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 1ab6e2b0b9..a845bc23b2 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -1160,6 +1160,7 @@ <literal>vmware</literal>, <literal>microsoft</literal>, <literal>oracle</literal>, + <literal>powervm</literal>, <literal>xen</literal>, <literal>bochs</literal>, <literal>uml</literal>, diff --git a/src/basic/virt.c b/src/basic/virt.c index 80128cb3aa..bb908847f5 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -93,6 +93,11 @@ static int detect_vm_device_tree(void) { _cleanup_closedir_ DIR *dir = NULL; struct dirent *dent; + if (access("/proc/device-tree/ibm,partition-name", F_OK) == 0 && + access("/proc/device-tree/hmc-managed?", F_OK) == 0 && + access("/proc/device-tree/chosen/qemu,graphic-width", F_OK) != 0) + return VIRTUALIZATION_POWERVM; + dir = opendir("/proc/device-tree"); if (!dir) { if (errno == ENOENT) { @@ -679,6 +684,7 @@ static const char *const virtualization_table[_VIRTUALIZATION_MAX] = { [VIRTUALIZATION_BHYVE] = "bhyve", [VIRTUALIZATION_QNX] = "qnx", [VIRTUALIZATION_ACRN] = "acrn", + [VIRTUALIZATION_POWERVM] = "powervm", [VIRTUALIZATION_VM_OTHER] = "vm-other", [VIRTUALIZATION_SYSTEMD_NSPAWN] = "systemd-nspawn", diff --git a/src/basic/virt.h b/src/basic/virt.h index 18aa5eff15..2f7f7203d2 100644 --- a/src/basic/virt.h +++ b/src/basic/virt.h @@ -22,6 +22,7 @@ enum { VIRTUALIZATION_BHYVE, VIRTUALIZATION_QNX, VIRTUALIZATION_ACRN, + VIRTUALIZATION_POWERVM, VIRTUALIZATION_VM_OTHER, VIRTUALIZATION_VM_LAST = VIRTUALIZATION_VM_OTHER, |