libvirt/src
Michal Privoznik da95bcb6b2 qemu: Substract isolcpus from all online affinity
When starting a domain and there's no vCPU/emulator pinning set,
we query the list of all online physical CPUs and set affinity of
the child process (which eventually becomes QEMU) to that list.
We can't assume libvirtd itself had affinity to all online CPUs
and since affinity of the child process is inherited, we should
fix it afterwards. But that's not necessarily correct. Users
might isolate some physical CPUs and we should avoid touching
them unless explicitly told so (i.e. vCPU/emulator pinning told
us so).

Therefore, when attempting to set affinity to all online CPUs
subtract the isolated ones.

Before this commit:

  root@localhost:~# cat /sys/devices/system/cpu/isolated
  19,21,23
  root@virtlab414:~# taskset -cp $(pgrep qemu)
  pid 14835's current affinity list: 0-23

After:

  root@virtlab414:~# taskset -cp $(pgrep qemu)
  pid 17153's current affinity list: 0-18,20,22

Resolves: https://issues.redhat.com/browse/RHEL-33082
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2024-05-06 15:38:58 +02:00
..
access api: add virNodeDeviceUpdate() 2024-02-26 11:03:51 +01:00
admin
bhyve conf: Introduce support for usb-mtp devices 2024-03-19 17:36:19 +01:00
ch ch_driver: Add additional validation for save/restore 2024-03-20 14:05:34 +01:00
conf conf: Change return value of some CPU feature APIs 2024-05-02 19:56:45 +02:00
cpu cpu: Add removedPolicy parameter to virCPUUpdate 2024-05-02 19:56:45 +02:00
cpu_map cpu_map: Drop 'mpx' from x86 cpu models 2024-05-02 19:56:45 +02:00
esx
hyperv hyperv: prevent potential NULL dereference 2024-05-06 09:35:45 +02:00
hypervisor domain_interface: Fix build on FreeBSD 2024-04-15 08:51:23 +02:00
interface
libxl libxl: Fix domxml-to-native conversion 2024-05-02 15:57:29 -06:00
locking
logging
lxc domain_interface: Introduce and use virDomainInterfaceClearQoS() 2024-04-12 20:45:15 +02:00
network
node_device node_device_driver: use g_autofree instead of VIR_FREE() 2024-03-19 13:31:29 +01:00
nwfilter
openvz openvz_driver: use g_autofree instead of VIR_FREE() 2024-03-19 13:31:25 +01:00
qemu qemu: Substract isolcpus from all online affinity 2024-05-06 15:38:58 +02:00
remote remote: properly initialize objects in ACL helpers 2024-04-03 09:34:35 +02:00
rpc rpc: ensure temporary GSource is removed from client event loop 2024-05-02 14:46:31 +01:00
secret systemd: Set service_extra_in/socket_extra_in everywhere 2023-10-25 12:19:32 +02:00
security security: Ensure file exists before attempting to restore label 2024-04-08 10:38:25 -06:00
storage
storage_file
test test: nodedev: fill active_config at driver startup time 2024-04-24 09:38:54 -04:00
util virhostcpu: Introduce virHostCPUGetIsolated() 2024-05-06 15:36:17 +02:00
vbox vbox: Drop needless g_new0(..., 0) in vbox_snapshot_conf.c 2024-04-13 23:16:54 +02:00
vmware
vmx vmx: Check serialX.vspc before serialX.fileName 2024-05-02 17:22:37 +02:00
vz
admin_protocol-structs
datatypes.c
datatypes.h
driver-hypervisor.h
driver-interface.h
driver-network.h
driver-nodedev.h
driver-nwfilter.h
driver-secret.h
driver-state.h
driver-storage.h
driver-stream.h
driver.c
driver.h
internal.h
libvirt_driver_modules.syms
libvirt_esx.syms
libvirt_internal.h
libvirt_libssh2.syms
libvirt_libssh.syms
libvirt_linux.syms
libvirt_logging.syms
libvirt_lxc.syms
libvirt_openvz.syms openvz: Add missing symbols to libvirt_openvz.syms 2021-06-14 12:05:54 +02:00
libvirt_private.syms virhostcpu: Introduce virHostCPUGetIsolated() 2024-05-06 15:36:17 +02:00
libvirt_probes.d
libvirt_public.syms
libvirt_qemu.syms
libvirt_remote.syms
libvirt_sasl.syms
libvirt_socket.syms
libvirt_vmware.syms
libvirt_vmx.syms
libvirt-domain-checkpoint.c
libvirt-domain-snapshot.c
libvirt-domain.c docs: Update doc for virDomainSave and virDomainRestore 2024-03-20 14:05:38 +01:00
libvirt-host.c
libvirt-interface.c
libvirt-lxc.c
libvirt-lxc.pc.in
libvirt-network.c network: ensure nparams is non-NULL and non-negative 2024-04-17 13:13:02 +01:00
libvirt-nodedev.c
libvirt-nwfilter.c
libvirt-qemu.c
libvirt-qemu.pc.in
libvirt-secret.c
libvirt-storage.c
libvirt-stream.c
libvirt.c
libvirt.conf
libvirt.pc.in
lock_protocol-structs
lxc_monitor_protocol-structs
lxc_protocol-structs
meson.build tests: Reimplement 'libvirtd-fail' case directly in meson 2024-04-02 14:24:30 +02:00
qemu_protocol-structs
README
remote_protocol-structs
virkeepaliveprotocol-structs
virnetprotocol-structs
virtd-admin.socket.in systemd: Improve and unify unit descriptions 2023-10-02 10:41:07 +02:00
virtd-ro.socket.in
virtd-tcp.socket.in
virtd-tls.socket.in
virtd.service.in
virtd.service.limitmemlock.extra.in
virtd.service.limitnofile.extra.in
virtd.service.oomscoreadjust.extra.in
virtd.service.tasksmax.extra.in
virtd.socket.in

       libvirt library code README
       ===========================

The directory provides the bulk of the libvirt codebase. Everything
except for the libvirtd daemon and client tools. The build uses a
large number of libtool convenience libraries - one for each child
directory, and then links them together for the final libvirt.so,
although some bits get linked directly to libvirtd daemon instead.

The files directly in this directory are supporting the public API
entry points & data structures.

There are two core shared modules to be aware of:

 * util/  - a collection of shared APIs that can be used by any
            code. This directory is always in the include path
            for all things built

 * conf/  - APIs for parsing / manipulating all the official XML
            files used by the public API. This directory is only
            in the include path for driver implementation modules

 * vmx/   - VMware VMX config handling (used by esx/ and vmware/)


Then there are the hypervisor implementations:

 * bhyve         - bhyve - The BSD Hypervisor
 * esx/          - VMware ESX and GSX support using vSphere API over SOAP
 * hyperv/       - Microsoft Hyper-V support using WinRM
 * lxc/          - Linux Native Containers
 * openvz/       - OpenVZ containers using cli tools
 * qemu/         - QEMU / KVM using qemu CLI/monitor
 * remote/       - Generic libvirt native RPC client
 * test/         - A "mock" driver for testing
 * vbox/         - Virtual Box using native API
 * vmware/       - VMware Workstation and Player using the vmrun tool
 * xen/          - Xen using hypercalls, XenD SEXPR & XenStore


Finally some secondary drivers that are shared for several HVs.
Currently these are used by LXC, OpenVZ, QEMU and Xen drivers.
The ESX, Hyper-V, Remote, Test & VirtualBox drivers all
implement the secondary drivers directly

 * cpu/          - CPU feature management
 * interface/    - Host network interface management
 * network/      - Virtual NAT networking
 * nwfilter/     - Network traffic filtering rules
 * node_device/  - Host device enumeration
 * secret/       - Secret management
 * security/     - Mandatory access control drivers
 * storage/      - Storage management drivers


Since both the hypervisor and secondary drivers can be built as
dlopen()able modules, it is *FORBIDDEN* to have build dependencies
between these directories. Drivers are only allowed to depend on
the public API, and the internal APIs in the util/ and conf/
directories