Merge "cpu: fix the privsep issue when offlining the cpu"

This commit is contained in:
Zuul 2023-06-07 21:37:30 +00:00 committed by Gerrit Code Review
commit 308633f93a
2 changed files with 8 additions and 0 deletions

View File

@ -60,6 +60,7 @@ def set_online(core: int) -> bool:
return get_online(core)
@nova.privsep.sys_admin_pctxt.entrypoint
def set_offline(core: int) -> bool:
filesystem.write_sys(os.path.join(gen_cpu_path(core), 'online'), data='0')
return not get_online(core)

View File

@ -0,0 +1,7 @@
---
fixes:
- |
The `CPU power management`_ feature has been fixed to use privsep to avoid
a FileNotFound error when offlining CPUs.
.. _CPU power management: https://docs.openstack.org/nova/latest/admin/cpu-topologies.html#configuring-cpu-power-management-for-dedicated-cores