Fix missing code from backport of 4.16 version of dom0 CPU reserve (#374)

Co-authored-by: Marcus Sorensen <mls@apple.com>
This commit is contained in:
Marcus Sorensen 2024-02-04 23:23:45 -07:00 committed by GitHub
parent b44710c8a9
commit f49265c14c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -502,6 +502,15 @@ public class AgentProperties{
*/
public static final Property<Integer> HOST_RESERVED_MEM_MB = new Property<>("host.reserved.mem.mb", 1024);
/**
* How many host CPUs to reserve for non-allocation.<br>
* This can be used to set aside CPU cores on the host for other tasks, such as running hyperconverged storage<br>
* processes, etc.
* Data type: Integer.<br>
* Default value: <code>0</code>
*/
public static final Property<Integer> HOST_RESERVED_CPU_CORE_COUNT = new Property<>("host.reserved.cpu.count", 0);
/**
* The model of Watchdog timer to present to the Guest.<br>
* For all models refer to the libvirt documentation.<br>

View File

@ -1064,8 +1064,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
// Reserve 1GB unless admin overrides
_dom0MinMem = ByteScaleUtils.mebibytesToBytes(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.HOST_RESERVED_MEM_MB));
value = (String)params.get("host.reserved.cpu.count");
_dom0MinCpuCores = NumbersUtil.parseInt(value, 0);
_dom0MinCpuCores = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.HOST_RESERVED_CPU_CORE_COUNT);
// Support overcommit memory for host if host uses ZSWAP, KSM and other memory
// compressing technologies