Source:
protected void executeVmCommand() { oldVm = getVm(); if (isUpdateVmTemplateVersion) { updateVmTemplateVersion(); return; } if (isRunningConfigurationNeeded()) { createNextRunSnapshot(); } VmHandler.warnMemorySizeLegal(getParameters().getVm().getStaticData(), getEffectiveCompatibilityVersion()); getVmStaticDao().incrementDbGeneration(getVm().getId()); newVmStatic = getParameters().getVmStaticData(); newVmStatic.setCreationDate(oldVm.getStaticData().getCreationDate()); if (getVm().isHostedEngine()) { registerRollbackHandler(new HostedEngineEditNotifier(getVm())); } VM userVm = new VM(); userVm.setStaticData(new VmStatic(newVmStatic)); if (newVmStatic.getCreationDate().equals(DateTime.getMinValue())) { newVmStatic.setCreationDate(new Date()); } if (getVm().isRunningOrPaused() && !getVm().isHostedEngine()) { if (!VmHandler.copyNonEditableFieldsToDestination(oldVm.getStaticData(), newVmStatic, isHotSetEnabled())) { throw new EngineException(EngineError.FAILED_UPDATE_RUNNING_VM); } if (isClusterLevelChange() && newVmStatic.getCustomCompatibilityVersion() == null) { newVmStatic.setCustomCompatibilityVersion(getParameters().getClusterLevelChangeFromVersion()); } } updateVmNetworks(); updateVmNumaNodes(); if (isHotSetEnabled()) { hotSetCpus(userVm); updateCurrentMemory(userVm); } final List<Guid> oldIconIds = IconUtils.updateVmIcon( oldVm.getStaticData(), newVmStatic, getParameters().getVmLargeIcon()); resourceManager.getVmManager(getVmId()).update(newVmStatic); if (getVm().isNotRunning()) { updateVmPayload(); getVmDeviceUtils().updateVmDevices(getParameters(), oldVm); updateWatchdog(); updateRngDevice(); updateGraphicsDevices(); updateVmHostDevices(); updateDeviceAddresses(); } IconUtils.removeUnusedIcons(oldIconIds); VmHandler.updateVmInitToDB(getParameters().getVmStaticData()); checkTrustedService(); liveUpdateCpuProfile(); setSucceeded(true); }

Target:
protected void executeVmCommand() { oldVm = getVm(); if (isUpdateVmTemplateVersion) { updateVmTemplateVersion(); return; } if (isRunningConfigurationNeeded()) { createNextRunSnapshot(); } VmHandler.warnMemorySizeLegal(getParameters().getVm().getStaticData(), getEffectiveCompatibilityVersion()); getVmStaticDao().incrementDbGeneration(getVm().getId()); newVmStatic = getParameters().getVmStaticData(); newVmStatic.setCreationDate(oldVm.getStaticData().getCreationDate()); if (getVm().isHostedEngine()) { registerRollbackHandler(new HostedEngineEditNotifier(getVm())); } VM userVm = new VM(); userVm.setStaticData(new VmStatic(newVmStatic)); if (newVmStatic.getCreationDate().equals(DateTime.getMinValue())) { newVmStatic.setCreationDate(new Date()); } if (getVm().isRunningOrPaused() && !getVm().isHostedEngine()) { if (!VmHandler.copyNonEditableFieldsToDestination(oldVm.getStaticData(), newVmStatic, isHotSetEnabled())) { throw new EngineException(EngineError.FAILED_UPDATE_RUNNING_VM); } if (isClusterLevelChange()) { newVmStatic.setCustomCompatibilityVersion(getParameters().getClusterLevelChangeFromVersion()); } } updateVmNetworks(); updateVmNumaNodes(); if (isHotSetEnabled()) { hotSetCpus(userVm); updateCurrentMemory(userVm); } final List<Guid> oldIconIds = IconUtils.updateVmIcon( oldVm.getStaticData(), newVmStatic, getParameters().getVmLargeIcon()); resourceManager.getVmManager(getVmId()).update(newVmStatic); if (getVm().isNotRunning()) { updateVmPayload(); getVmDeviceUtils().updateVmDevices(getParameters(), oldVm); updateWatchdog(); updateRngDevice(); updateGraphicsDevices(); updateVmHostDevices(); updateDeviceAddresses(); } IconUtils.removeUnusedIcons(oldIconIds); VmHandler.updateVmInitToDB(getParameters().getVmStaticData()); checkTrustedService(); liveUpdateCpuProfile(); setSucceeded(true); }