Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allow hot plug CPU with exclusive pinning #540

Merged
merged 2 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public class VmCommonUtils {
* @return true, if any CPUs are to be hotplugged, false otherwise
*/
public static boolean isCpusToBeHotpluggedOrUnplugged(VM source, VM destination) {
return cpuSocketsChanged(source, destination)
&& !source.getCpuPinningPolicy().isExclusive();
}

private static boolean cpuSocketsChanged(VM source, VM destination) {
return source.getCpuPerSocket() == destination.getCpuPerSocket()
&& source.getNumOfSockets() != destination.getNumOfSockets()
&& source.getThreadsPerCpu() == destination.getThreadsPerCpu();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public interface NextRunFieldMessages extends ConstantsWithLookup {

String vNumaNodeList();

String cpuPinningPolicy();

// Devices

String memballoon();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ kernelUrl=Kernel URL
kernelParams=Kernel Parameters
initrdUrl=Initrd Url
vNumaNodeList=NUMA Nodes Configuration
cpuPinningPolicy=CPU Pinning Policy
# Devices - from VmManagementParametersBase with @EditableDeviceOnVmStatusField annotation
memballoon=Memory Balloon
watchdog=Watchdog
Expand Down