Skip to content

Commit

Permalink
webadmin: Update VM NUMA nodes if VM memory or CPU count has changed
Browse files Browse the repository at this point in the history
Detect if the total memory or the number of CPUs
were changed in the Edit dialog.
If they were, NUMA nodes are changed to fit the new values.

Change-Id: I67b796a128c0af17dd54056b862798cd0d650bcf
Bug-Url: https://bugzilla.redhat.com/1291064
Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
  • Loading branch information
akrejcir authored and MarSik committed Feb 20, 2017
1 parent 5db67a7 commit 54fc01a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,13 @@ private void clearCpuPinning() {
private void preSavePhase3() {
final UnitVmModel model = (UnitVmModel) getWindow();
final String name = model.getName().getEntity();

if (!model.getIsNew() && model.getNumaEnabled().getEntity() &&
(!model.getMemSize().getEntity().equals(getcurrentVm().getMemSizeMb()) ||
!model.getTotalCPUCores().getEntity().equals(Integer.toString(getcurrentVm().getNumOfCpus())) )) {
model.setNumaChanged(true);
}

validateVm(model, name);
}

Expand Down

0 comments on commit 54fc01a

Please sign in to comment.