Description of problem: /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus on machine.slice creation is always set to cores that emulator is pinned to via <emulatorpin>. This results in following error on VM startup: Unable to write to '/sys/fs/cgroup/cpuset/machine.slice/machine-qemu\x2d2\x2dwin.scope/vcpu0/cpuset.cpus': Permission denied Compiled against library: libvirt 2.3.0 Using library: libvirt 2.3.0 Using API: QEMU 2.3.0 Running hypervisor: QEMU 2.7.0 Always reproducible. Steps to Reproduce: 1. Create VM with cpu setup: <vcpu placement='static'>4</vcpu> <cputune> <vcpupin vcpu='0' cpuset='2'/> <vcpupin vcpu='1' cpuset='3'/> <vcpupin vcpu='2' cpuset='4'/> <vcpupin vcpu='3' cpuset='5'/> <emulatorpin cpuset='0-1'/> </cputune> <cpu mode='host-passthrough'> <topology sockets='1' cores='4' threads='1'/> </cpu> 2. Start VM via virsh or virt-manager. Actual results: Error: Unable to write to '/sys/fs/cgroup/cpuset/machine.slice/machine-qemu\x2d2\x2dwin.scope/vcpu0/cpuset.cpus': Permission denied ~ % cat /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus 0-1 Expected results: No error, VM should start. ~ % cat /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus 0-5 Additional info: As a workaround i added following line to /etc/libvirt/hooks/qemu script: echo 0-5 > /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus With this workaround VM always fails starting the first time but starts properly the second time.
Thank you for reporting this issue to the libvirt project. Unfortunately we have been unable to resolve this issue due to insufficient maintainer capacity and it will now be closed. This is not a reflection on the possible validity of the issue, merely the lack of resources to investigate and address it, for which we apologise. If you none the less feel the issue is still important, you may choose to report it again at the new project issue tracker https://gitlab.com/libvirt/libvirt/-/issues The project also welcomes contribution from anyone who believes they can provide a solution.