Skip to content

Commit

Permalink
webadmin: Do not allow hot plug CPU with exclusive pinning
Browse files Browse the repository at this point in the history
It is not possible to hot plug CPUs when using exclusive
CPU pinning. Instead of failing on the backend, the CPU
is now listed as "Changes that require Virtual Machine restart"
instead of "Changes that can be applied immediately" in the
"Pending Virtual Machine changes" dialog.

Bug-Url: https://bugzilla.redhat.com/2097717
  • Loading branch information
ljelinkova committed Jul 27, 2022
1 parent 87d5aca commit 6ad1213
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 6ad1213

Please sign in to comment.