use of org.ovirt.engine.core.common.action.HotSetAmountOfMemoryParameters in project ovirt-engine by oVirt.
the class UpdateVmCommand method hotPlugMemoryDevice.
private void hotPlugMemoryDevice(int currentMemoryMb, int newAmountOfMemoryMb) {
HotSetAmountOfMemoryParameters params = new HotSetAmountOfMemoryParameters(newVmStatic, currentMemoryMb < newAmountOfMemoryMb ? PlugAction.PLUG : PlugAction.UNPLUG, // We always use node 0, auto-numa should handle the allocation
0, newAmountOfMemoryMb - currentMemoryMb);
ActionReturnValue setAmountOfMemoryResult = runInternalAction(ActionType.HotSetAmountOfMemory, params, cloneContextAndDetachFromParent());
// into the OVF store and automatically used during the next HE VM start
if (!getVm().isHostedEngine()) {
newVmStatic.setMemSizeMb(setAmountOfMemoryResult.getSucceeded() ? newAmountOfMemoryMb : currentMemoryMb);
}
logHotSetActionEvent(setAmountOfMemoryResult, AuditLogType.FAILED_HOT_SET_MEMORY);
}
Aggregations