forked from pool/systemd
73 lines
2.3 KiB
Diff
73 lines
2.3 KiB
Diff
From f41925b4e442a34c93ad120ef1426c974a047ed1 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Blume <Thomas.Blume@suse.com>
|
|
Date: Fri, 18 Jul 2014 09:13:36 -0400
|
|
Subject: [PATCH] systemd-detect-virt: detect s390 virtualization
|
|
|
|
A system that is running on a logical partition (LPAR) provided by
|
|
PR/SM has access to physical hardware (except CPU). It is true that
|
|
PR/SM abstracts the hardware, but only for sharing purposes.
|
|
|
|
Details are statet at:
|
|
|
|
http://publib.boulder.ibm.com/infocenter/eserver/v1r2/topic/eicaz/eicazzlpar.htm
|
|
|
|
-->--
|
|
In other words, PR/SM transforms physical resources into virtual resources so
|
|
that many logical partitions can share the same physical resources.
|
|
--<--
|
|
|
|
Still, from the OS point of view, the shared virtual resource is real
|
|
hardware. ConditionVirtualization must be set to false if the OS runs
|
|
directly on PR/SM (e.g. in an LPAR).
|
|
|
|
[zj: reorder code so that variables are not allocated when #if-def is
|
|
false. Add commit message.]
|
|
---
|
|
man/systemd.unit.xml | 1 +
|
|
src/shared/virt.c | 17 +++++++++++++++++
|
|
2 files changed, 18 insertions(+)
|
|
|
|
diff --git man/systemd.unit.xml man/systemd.unit.xml
|
|
index 6447584..86a8cbb 100644
|
|
--- man/systemd.unit.xml
|
|
+++ man/systemd.unit.xml
|
|
@@ -996,6 +996,7 @@
|
|
virtualization solution, or one of
|
|
<varname>qemu</varname>,
|
|
<varname>kvm</varname>,
|
|
+ <varname>zvm</varname>,
|
|
<varname>vmware</varname>,
|
|
<varname>microsoft</varname>,
|
|
<varname>oracle</varname>,
|
|
diff --git src/shared/virt.c src/shared/virt.c
|
|
index 20a8d7c..b436895 100644
|
|
--- src/shared/virt.c
|
|
+++ src/shared/virt.c
|
|
@@ -220,6 +220,23 @@ int detect_vm(const char **id) {
|
|
goto finish;
|
|
}
|
|
|
|
+#if defined(__s390__)
|
|
+ {
|
|
+ _cleanup_free_ char *t = NULL;
|
|
+
|
|
+ r = get_status_field("/proc/sysinfo", "VM00 Control Program:", &t);
|
|
+ if (r >= 0) {
|
|
+ if (streq(t, "z/VM"))
|
|
+ _id = "zvm";
|
|
+ else
|
|
+ _id = "kvm";
|
|
+ r = 1;
|
|
+
|
|
+ goto finish;
|
|
+ }
|
|
+ }
|
|
+#endif
|
|
+
|
|
r = 0;
|
|
|
|
finish:
|
|
--
|
|
1.7.9.2
|
|
|