Re: [libvirt PATCH 5/6] hostcpu: Implement virHostCPUGetSignature for s390

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 20.05.20 14:20, Boris Fiuczynski wrote:
> On 5/18/20 2:56 PM, Jiri Denemark wrote:
>> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
>> ---
>>   src/util/virhostcpu.c                            | 16 +++++++++++++++-
>>   .../linux-s390x-with-frequency.signature         |  1 +
>>   2 files changed, 16 insertions(+), 1 deletion(-)
>>   create mode 100644 tests/virhostcpudata/linux-s390x-with-frequency.signature
>>
>> diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
>> index 0ce895cb39..0caf7959ef 100644
>> --- a/src/util/virhostcpu.c
>> +++ b/src/util/virhostcpu.c
>> @@ -1430,8 +1430,9 @@ virHostCPUReadSignature(virArch arch,
>>       g_autofree char *model = NULL;
>>       g_autofree char *stepping = NULL;
>>       g_autofree char *revision = NULL;
>> +    g_autofree char *proc = 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 +1480,19 @@ 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]);
>> +            }
> 
> To catch scenarios of moving from LPAR to nested kvm or the other way around facilties must be added here as well.
> 

Yes. This would also cover the case when a firmware update adds features.




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux