提交 d3d87e0c 编写于 作者: J Jiri Denemark

hostcpu: Implement virHostCPUGetSignature for s390

Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com>
上级 2a68ceaa
......@@ -1430,8 +1430,10 @@ virHostCPUReadSignature(virArch arch,
g_autofree char *model = NULL;
g_autofree char *stepping = NULL;
g_autofree char *revision = NULL;
g_autofree char *proc = NULL;
g_autofree char *facilities = NULL;
if (!ARCH_IS_X86(arch) && !ARCH_IS_PPC64(arch))
if (!ARCH_IS_X86(arch) && !ARCH_IS_PPC64(arch) && !ARCH_IS_S390(arch))
return 0;
while (fgets(line, lineLen, cpuinfo)) {
......@@ -1479,6 +1481,23 @@ virHostCPUReadSignature(virArch arch,
*signature = g_strdup_printf("%s, rev %s", name, revision);
return 0;
}
} else if (ARCH_IS_S390(arch)) {
if (STREQ(parts[0], "vendor_id")) {
if (!vendor)
vendor = g_steal_pointer(&parts[1]);
} else if (STREQ(parts[0], "processor 0")) {
if (!proc)
proc = g_steal_pointer(&parts[1]);
} else if (STREQ(parts[0], "facilities")) {
if (!facilities)
facilities = g_steal_pointer(&parts[1]);
}
if (vendor && proc && facilities) {
*signature = g_strdup_printf("%s, %s, facilities: %s",
vendor, proc, facilities);
return 0;
}
}
}
......
IBM/S390, version = 00, identification = 145F07, machine = 2964, facilities: 0 1 2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 40 41 42 43 44 45 46 47 48 49 50 51 52 53 55 57 64 65 66 67 68 69 70 71 72 73 75 76 77 78 80 128 129 131 132 142 143
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册