[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [Qemu-devel] [PATCH 3/3] qmp: add architecture specific
From: |
Viktor Mihajlovski |
Subject: |
Re: [qemu-s390x] [Qemu-devel] [PATCH 3/3] qmp: add architecture specific cpu data for query-cpus-fast |
Date: |
Tue, 13 Feb 2018 17:12:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 12.02.2018 17:23, Cornelia Huck wrote:
[...]
>> diff --git a/cpus.c b/cpus.c
>> index 6df6660..af67826 100644
>> --- a/cpus.c
>> +++ b/cpus.c
>> @@ -2166,6 +2166,10 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
>> MachineClass *mc = MACHINE_GET_CLASS(ms);
>> CpuInfoFastList *head = NULL, *cur_item = NULL;
>> CPUState *cpu;
>> +#if defined(TARGET_S390X)
>> + S390CPU *s390_cpu;
>> + CPUS390XState *env;
>> +#endif
>>
>> CPU_FOREACH(cpu) {
>> CpuInfoFastList *info = g_malloc0(sizeof(*info));
>> @@ -2183,6 +2187,12 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
>> info->value->props = props;
>> }
>>
>> +#if defined(TARGET_S390X)
>> + s390_cpu = S390_CPU(cpu);
>> + env = &s390_cpu->env;
>
> You should be able to omit the s390_cpu variable by using
>
> env = &S390_CPU(cpu)->env;
>
True, but I wanted to stay in style with the code in qmp_query_cpus.
>> + info->value->arch = CPU_INFO_ARCH_S390;
>> + info->value->u.s390.cpu_state = env->cpu_state;
>> +#endif
>> if (!cur_item) {
>> head = cur_item = info;
>> } else {
>
> As you mentioned in the patch description, the duplication is a bit
> awkward. I'll let the QAPI experts judge that; otherwise, this looks
> fine to me.
>
--
Regards,
Viktor Mihajlovski
- Re: [qemu-s390x] [PATCH 1/3] qmp: expose s390-specific CPU info, (continued)
Re: [qemu-s390x] [PATCH 1/3] qmp: expose s390-specific CPU info, David Hildenbrand, 2018/02/12
[qemu-s390x] [PATCH 2/3] qmp: add query-cpus-fast, Viktor Mihajlovski, 2018/02/12
[qemu-s390x] [PATCH 3/3] qmp: add architecture specific cpu data for query-cpus-fast, Viktor Mihajlovski, 2018/02/12
Re: [qemu-s390x] [PATCH 3/3] qmp: add architecture specific cpu data for query-cpus-fast, Luiz Capitulino, 2018/02/12
Re: [qemu-s390x] [PATCH 0/3] add query-cpu-fast and related s390 changes, Cornelia Huck, 2018/02/12