]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: fix detection of vCPU pids when multiple dies are present
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 13 Mar 2020 16:43:26 +0000 (16:43 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 16 Mar 2020 16:00:27 +0000 (16:00 +0000)
commit8b789c6574454863acbd2511fc2094d1e63e8154
tree891118d01010eaa57106028c9f37a1b81f2d3c35
parente8e44020c8bc18c46b98cf3481eb09293756e40c
qemu: fix detection of vCPU pids when multiple dies are present

The logic for querying hotpluggable CPUs needs to sort the list
of CPUs returned by QEMU. Unfortunately our sorting method failed
to use the die_id field, so CPUs were not correctly sorted.

This is seen when configuring a guest with partially populated
CPUs

  <vcpu placement='static' current='1'>16</vcpu>
  <cpu...>
    <topology sockets='4' dies='2' cores='1' threads='2'/>
  </cpu>

Then trying to start it would fail:

  # virsh -c qemu:///system start demo
  error: Failed to start domain demo
  error: internal error: qemu didn't report thread id for vcpu '0'

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c