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
Bug-Url: https://bugzilla.redhat.com/2111088
  • Loading branch information
ljelinkova authored and ahadas committed Jul 28, 2022
1 parent 73d2162 commit c9f947e
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 c9f947e

Please sign in to comment.