[systemd-devel] [PATCH] systemd-detect-s390-virt: add virtualization detection on s390x
Thomas Blume
Thomas.Blume at suse.com
Mon Jul 7 03:25:46 PDT 2014
On Fri, 4 Jul 2014, Zbigniew Jędrzejewski-Szmek wrote:
>> +#if defined(__s390x__)
>> + /* First layer virtualization (PR/SM) is always present on s390x */
>> + _id = "PR/SM";
>> + r = 1;
> What does this mean? Is it like XEN dom0, i.e. normianally a virtuallized OS,
> but one that has full access to hardware? We recently [1] started to report
> that as non-virtualized, because what matters is the ability to access hardware,
> and not the way that the system is built.
>
> [1] 37287585b6ba9a5
The difference is that on s390 there is no direct access to hardware on OS level.
See my reply to Lennart for further details.
>> +
>> + /* Check for second layer virtualization */
>> + _cleanup_fclose_ FILE *f = NULL;
>> + char line[LINE_MAX];
>> + f = fopen("/proc/sysinfo", "re");
>> + if (f) {
>> + FOREACH_LINE(line, f, return -errno) {
>> + if (startswith(line, "VM00 Control Program:")) {
>> + if (strstr(line,"z/VM"))
>> + _id = "z/VM";
>> + else if (strstr(line,"KVM/Linux"))
>> + _id = "KVM";
>> + break;
>> + }
>> + }
>> + }
> Can you use get_status_field for this?
ok
Regards
Thomas
More information about the systemd-devel
mailing list