mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-22 22:03:43 +03:00
basic/virt: Detect PowerVM hypervisor
Currently systemd-detect-virt fails to detect running under PowerVM. Add code to detect PowerVM based on code in util-linux. Signed-off-by: Michal Suchanek <msuchanek@suse.de> (cherry picked from commit 3224e38bb6b3287ca253cbafb460a150544d5818)
This commit is contained in:
parent
ae98ab9e67
commit
e037fe7241
@ -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>
|
||||
@ -92,6 +92,11 @@
|
||||
<entry>Oracle VM VirtualBox (historically marketed by innotek and Sun Microsystems), for legacy and KVM hypervisor</entry>
|
||||
</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>
|
||||
|
@ -1163,6 +1163,7 @@
|
||||
<literal>vmware</literal>,
|
||||
<literal>microsoft</literal>,
|
||||
<literal>oracle</literal>,
|
||||
<literal>powervm</literal>,
|
||||
<literal>xen</literal>,
|
||||
<literal>bochs</literal>,
|
||||
<literal>uml</literal>,
|
||||
|
@ -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) {
|
||||
@ -668,6 +673,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",
|
||||
|
@ -22,6 +22,7 @@ enum {
|
||||
VIRTUALIZATION_BHYVE,
|
||||
VIRTUALIZATION_QNX,
|
||||
VIRTUALIZATION_ACRN,
|
||||
VIRTUALIZATION_POWERVM,
|
||||
VIRTUALIZATION_VM_OTHER,
|
||||
VIRTUALIZATION_VM_LAST = VIRTUALIZATION_VM_OTHER,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user