[libvirt] [PATCH 2/2] qemu: monitor: Properly propagate the 'qemu_id' field through the matcher

Viktor Mihajlovski mihajlov at linux.vnet.ibm.com
Tue Nov 22 12:14:10 UTC 2016


On 22.11.2016 10:51, Peter Krempa wrote:
> Commit 3f71c797689a4a70 added 'qemu_id' field to track the id of the cpu
> as reported by query-cpus. The patch did not include changes necessary
> to propagate the id through the functions matching the data to the
> libvirt cpu structures and thus all vcpus had id 0.
> ---
>  src/qemu/qemu_monitor.c                            |  3 +++
>  .../qemumonitorjson-cpuinfo-ppc64-basic.data       |  8 ++++++++
>  .../qemumonitorjson-cpuinfo-ppc64-hotplug-1.data   | 16 +++++++++++++++
>  .../qemumonitorjson-cpuinfo-ppc64-hotplug-2.data   | 24 ++++++++++++++++++++++
>  .../qemumonitorjson-cpuinfo-ppc64-hotplug-4.data   | 24 ++++++++++++++++++++++
>  .../qemumonitorjson-cpuinfo-ppc64-no-threads.data  |  8 ++++++++
>  ...emumonitorjson-cpuinfo-x86-basic-pluggable.data |  5 +++++
>  .../qemumonitorjson-cpuinfo-x86-full.data          | 11 ++++++++++
>  tests/qemumonitorjsontest.c                        |  3 +++
>  9 files changed, 102 insertions(+)
> 
> diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
> index 3ff31e4..3f86887 100644
> --- a/src/qemu/qemu_monitor.c
> +++ b/src/qemu/qemu_monitor.c
> @@ -1672,6 +1672,7 @@ qemuMonitorCPUInfoClear(qemuMonitorCPUInfoPtr cpus,
> 
>      for (i = 0; i < ncpus; i++) {
>          cpus[i].id = 0;
> +        cpus[i].qemu_id = -1;
>          cpus[i].socket_id = -1;
>          cpus[i].core_id = -1;
>          cpus[i].thread_id = -1;
> @@ -1729,6 +1730,7 @@ qemuMonitorGetCPUInfoLegacy(struct qemuMonitorQueryCpusEntry *cpuentries,
>          if (i < ncpuentries) {
>              vcpus[i].tid = cpuentries[i].tid;
>              vcpus[i].halted = cpuentries[i].halted;
> +            vcpus[i].qemu_id = cpuentries[i].qemu_id;
>          }
> 
>          /* for legacy hotplug to work we need to fake the vcpu count added by
> @@ -1866,6 +1868,7 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl
>              }
>          }
> 
> +        vcpus[anyvcpu].qemu_id = cpuentries[j].qemu_id;
>          vcpus[anyvcpu].tid = cpuentries[j].tid;
>          vcpus[anyvcpu].halted = cpuentries[j].halted;
>      }
Looks good to me. Since presently s390 does only support legacy hotplug
w/o unplug, the second hunk will essentially do the trick.
[...]

Thanks!
-- 

Mit freundlichen Grüßen/Kind Regards
   Viktor Mihajlovski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Köderitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294




More information about the libvir-list mailing list