[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [PATCH 2/3] qmp: add query-cpus-fast
From: |
Viktor Mihajlovski |
Subject: |
Re: [qemu-s390x] [PATCH 2/3] qmp: add query-cpus-fast |
Date: |
Tue, 13 Feb 2018 16:14:33 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 12.02.2018 17:50, Dr. David Alan Gilbert wrote:
[...]
>> diff --git a/hmp.c b/hmp.c
>> index a6b94b7..598bfe5 100644
>> --- a/hmp.c
>> +++ b/hmp.c
>> @@ -410,6 +410,27 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict)
>> qapi_free_CpuInfoList(cpu_list);
>> }
>>
>> +void hmp_info_cpus_fast(Monitor *mon, const QDict *qdict)
>> +{
>> + CpuInfoFastList *head, *cpu;
>> + TargetInfo *target;
>> +
>> + target = qmp_query_target(NULL);
>> + monitor_printf(mon, "CPU architecture is '%s'\n\n", target->arch);
>> + qapi_free_TargetInfo(target);
>> +
>> + head = qmp_query_cpus_fast(NULL);
>> +
>> + for (cpu = head; cpu; cpu = cpu->next) {
>> + monitor_printf(mon, "CPU%" PRId64 "\n", cpu->value->cpu_index);
>> + monitor_printf(mon, " thread-id=%" PRId64 "\n",
>> cpu->value->thread_id);
>> + monitor_printf(mon, " qom-path=%s\n", cpu->value->qom_path);
>> + monitor_printf(mon, "\n");
>> + }
I started some prototyping in libvirt and stumbled over the changed
layout of "info cpus_fast" vs. "info cpus". IMHO it would be better to
stick with the original format (one line per CPU). I'll post a v2.
>> +
>> + qapi_free_CpuInfoFastList(head);
>> +}
>> +
>> static void print_block_info(Monitor *mon, BlockInfo *info,
>> BlockDeviceInfo *inserted, bool verbose)
>> {
>> diff --git a/hmp.h b/hmp.h
>> index 1143db4..93fb4e4 100644
>> --- a/hmp.h
>> +++ b/hmp.h
>> @@ -29,6 +29,7 @@ void hmp_info_migrate_capabilities(Monitor *mon, const
>> QDict *qdict);
>> void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict);
>> void hmp_info_migrate_cache_size(Monitor *mon, const QDict *qdict);
>> void hmp_info_cpus(Monitor *mon, const QDict *qdict);
>> +void hmp_info_cpus_fast(Monitor *mon, const QDict *qdict);
>> void hmp_info_block(Monitor *mon, const QDict *qdict);
>> void hmp_info_blockstats(Monitor *mon, const QDict *qdict);
>> void hmp_info_vnc(Monitor *mon, const QDict *qdict);
>
> For HMP:
>
> Acked-by: Dr. David Alan Gilbert <address@hidden>
>
[...]
--
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