Skip to content

Commit bb472db

Browse files
sbauzagibizer
authored andcommitted
cpu: fix the privsep issue when offlining the cpu
In Icb913ed9be8d508de35e755a9c650ba25e45aca2 we forgot to add a privsep decorator for the set_offline() method. Change-Id: I769d35907ab9466fe65b942295fd7567a757087a Closes-Bug: #2022955 (cherry picked from commit 3fab437)
1 parent a931b0b commit bb472db

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

nova/virt/libvirt/cpu/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def set_online(core: int) -> bool:
6060
return get_online(core)
6161

6262

63+
@nova.privsep.sys_admin_pctxt.entrypoint
6364
def set_offline(core: int) -> bool:
6465
filesystem.write_sys(os.path.join(gen_cpu_path(core), 'online'), data='0')
6566
return not get_online(core)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
The `CPU power management`_ feature has been fixed to use privsep to avoid
5+
a FileNotFound error when offlining CPUs.
6+
7+
.. _CPU power management: https://docs.openstack.org/nova/latest/admin/cpu-topologies.html#configuring-cpu-power-management-for-dedicated-cores

0 commit comments

Comments
 (0)