Bug 1386513 - Using emulatorpin sets machine.slice/cpuset.cpus incorrectly
Summary: Using emulatorpin sets machine.slice/cpuset.cpus incorrectly
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-19 07:11 UTC by rokupstys
Modified: 2024-12-17 12:35 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-12-17 12:35:36 UTC
Embargoed:


Attachments (Terms of Use)

Description rokupstys 2016-10-19 07:11:31 UTC
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.

Comment 1 Daniel Berrangé 2024-12-17 12:35:36 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.