libvirt/src/qemu
Andrea Bolognani 5f2212c062 qemu: Fix qemuProcessInitCpuAffinity()
Ever since the feature was introduced with commit 0f8e7ae33a,
it has contained a logic error in that it attempted to use a NUMA
node map where a CPU map was expected.

Because of that, guests using <numatune> might 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
48,56,64,72,80,88 - a valid input for virProcessSetAffinity().

https://bugzilla.redhat.com/show_bug.cgi?id=1703661

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-06-04 09:29:35 +02:00
..
EVENTHANDLERS.txt
libvirtd_qemu.aug
Makefile.inc.am maint: Add filetype annotations to Makefile.inc.am 2019-04-12 16:55:38 +02:00
MIGRATION.txt
qemu_agent.c
qemu_agent.h
qemu_alias.c
qemu_alias.h
qemu_block.c qemu: block: Use VIR_RETURN_PTR 2019-04-10 16:34:57 +02:00
qemu_block.h qemu: block: Introduce and use AUTOPTR func for qemuBlockStorageSourceAttachDataPtr 2019-04-10 16:34:57 +02:00
qemu_blockjob.c qemu: blockjob: Fix saving of inactive XML after completed legacy blockjob 2019-05-17 13:25:06 +02:00
qemu_blockjob.h qemu: blockjob: Fix documentation for 'newstate' of _qemuBlockJobData 2019-05-21 14:22:05 +02:00
qemu_capabilities.c qemu: Make virQEMUCapsProbeHostCPUForEmulator more generic 2019-06-03 18:07:16 +02:00
qemu_capabilities.h qemu: Introduce QEMU_CAPS_MACHINE_VIRT_IOMMU 2019-06-03 17:40:45 +02:00
qemu_capspriv.h qemu: Make virQEMUCapsProbeHostCPUForEmulator more generic 2019-06-03 18:07:16 +02:00
qemu_cgroup.c qemu_cgroup: Remove unused qemuSetupCpusetMems 2019-04-18 17:59:19 +02:00
qemu_cgroup.h qemu_cgroup: Remove unused qemuSetupCpusetMems 2019-04-18 17:59:19 +02:00
qemu_command.c qemu: Format SMMUv3 IOMMU 2019-06-03 17:40:57 +02:00
qemu_command.h
qemu_conf.c qemu: remove qemuGetDomainDefaultHugepath 2019-04-10 16:24:33 +02:00
qemu_conf.h qemu: remove qemuGetDomainDefaultHugepath 2019-04-10 16:24:33 +02:00
qemu_domain_address.c qemu: Partially convert to net model enum 2019-04-16 13:11:08 -04:00
qemu_domain_address.h
qemu_domain.c qemu: Move capability checks for IOMMU features 2019-06-03 17:40:54 +02:00
qemu_domain.h qemu: Split entry points to qemuDomainStorageSourceChainAccessPrepare 2019-05-09 15:55:35 +02:00
qemu_driver.c qemu: monitor: Don't pass full flags to qemuMonitorJSONDriveMirror 2019-05-21 14:22:06 +02:00
qemu_driver.h
qemu_extdevice.c
qemu_extdevice.h
qemu_firmware.c
qemu_firmware.h
qemu_hostdev.c
qemu_hostdev.h
qemu_hotplug.c qemu: Split entry points to qemuDomainStorageSourceChainAccessPrepare 2019-05-09 15:55:35 +02:00
qemu_hotplug.h
qemu_hotplugpriv.h
qemu_interface.c Revert "virt drivers: don't handle type=network after resolving actual network type" 2019-04-30 14:42:22 +01:00
qemu_interface.h
qemu_migration_cookie.c
qemu_migration_cookie.h
qemu_migration_params.c Always put _LAST enums on second line of VIR_ENUM_IMPL 2019-04-11 12:47:23 -04:00
qemu_migration_params.h
qemu_migration_paramspriv.h
qemu_migration.c qemu: monitor: Don't pass full flags to qemuMonitorJSONDriveMirror 2019-05-21 14:22:06 +02:00
qemu_migration.h
qemu_monitor_json.c qemu: monitor: Use VIR_AUTOPTR in qemuMonitorJSON(Drive/Blockdev)Mirror 2019-05-21 14:22:07 +02:00
qemu_monitor_json.h qemu: monitor: Don't pass full flags to qemuMonitorJSONDriveMirror 2019-05-21 14:22:06 +02:00
qemu_monitor_priv.h
qemu_monitor_text.c qemu: monitor: check for common 'Error: ' string 2019-04-23 11:05:44 -04:00
qemu_monitor_text.h
qemu_monitor.c qemu: monitor: Don't pass full flags to qemuMonitorJSONDriveMirror 2019-05-21 14:22:06 +02:00
qemu_monitor.h qemu: monitor: Don't pass full flags to qemuMonitorJSONDriveMirror 2019-05-21 14:22:06 +02:00
qemu_parse_command.c conf: net: Add wrapper functions for <model> value 2019-04-16 13:11:08 -04:00
qemu_parse_command.h
qemu_process.c qemu: Fix qemuProcessInitCpuAffinity() 2019-06-04 09:29:35 +02:00
qemu_process.h
qemu_processpriv.h
qemu_qapi.c qemu: qapi: Implement worker for introspecting alternate types 2019-05-06 09:46:06 +02:00
qemu_qapi.h
qemu_security.c
qemu_security.h
qemu_tpm.c
qemu_tpm.h
qemu.conf qemu.conf: Make nvram list obsolete 2019-05-02 15:09:45 +02:00
test_libvirtd_qemu.aug.in
THREADS.txt