[libvirt] [PATCH 4/4] qemu: Fix qemuProcessInitCpuAffinity()

Ján Tomko jtomko at redhat.com
Mon Jun 3 12:15:08 UTC 2019


On Fri, May 31, 2019 at 05:22:02PM +0200, Andrea Bolognani wrote:
>Commit f136b83139c6 made some changes in the way we set CPU
>affinity for QEMU processes, and while doing so unfortunately
>also introduced a logic bug in that it tried to use a NUMA node
>map where a CPU map was expected.
>
>Because of that, guests using <numatune> would suddenly fail to
>start:
>
>  # virsh start guest
>  error: Failed to start domain guest
>  error: cannot set CPU affinity on process 40055: Invalid argument
>
>This was particularly easy to trigger on POWER 8 machines,
>where secondary threads always show up as offline in the host:
>having
>
>  <numatune>
>    <memory mode='strict' placement='static' nodeset='1'/>
>  </numatune>
>
>in the guest configuration, for example, would result in libvirt
>trying to set the process affinity so that it would prefer
>running on CPU 1, but since that's a secondary thread and thus
>shows up as offline, the operation would fail, and so would
>starting the guest.
>
>Use the newly introduced virNumaNodesetToCPUset() to convert
>the NUMA node map to a CPU map, which in the example above would
>be 8-15 with CPU 8 showing up as online in the guest.
>
>https://bugzilla.redhat.com/show_bug.cgi?id=1703661
>
>Signed-off-by: Andrea Bolognani <abologna at redhat.com>
>---
> src/qemu/qemu_process.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190603/9487ac2b/attachment-0001.sig>


More information about the libvir-list mailing list