Source:
<code>protected boolean removeMemoryVolumes(String memVols, VdcActionType parentCommand, boolean startPollingTasks) { List<Guid> guids = GuidUtils.getGuidListFromString(memVols); if (guids.size() == 6) { setStorageDomainId(guids.get(0)); boolean postZero = LinqUtils.filter(getDiskDao().getAllForVm(getVm().getId()), new Predicate<Disk>() { @Override public boolean eval(Disk disk) { return ImagesHandler.shouldWipeAfterDelete( <START> disk.isWipeAfterDelete(), getStorageDomain().getStorageType()); <END> } }).size() > 0; Guid taskId1 = persistAsyncTaskPlaceHolder(parentCommand, DELETE_PRIMARY_IMAGE_TASK_KEY); VDSReturnValue vdsRetValue = runVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(guids.get(1), guids.get(0), guids.get(2), postZero, false)); if (!vdsRetValue.getSucceeded()) { return false; } Guid guid1 = createTask(taskId1, vdsRetValue.getCreationInfo(), parentCommand, VdcObjectType.Storage, guids.get(0)); getTaskIdList().add(guid1); Guid taskId2 = persistAsyncTaskPlaceHolder(parentCommand, DELETE_SECONDARY_IMAGES_TASK_KEY); vdsRetValue = runVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(guids.get(1), guids.get(0), guids.get(4), postZero, false)); if (!vdsRetValue.getSucceeded()) { if (startPollingTasks) { TaskManagerUtil.startPollingTask(guid1); } return false; } Guid guid2 = createTask(taskId2, vdsRetValue.getCreationInfo(), parentCommand); getTaskIdList().add(guid2); if (startPollingTasks) { TaskManagerUtil.startPollingTask(guid1); TaskManagerUtil.startPollingTask(guid2); } } return true; }</code><technical_language>This is wrong. wiping memory volume care storage stored upon, disks. E.g., could, theoretically, disks NFS mount memory hibernated a fast block device</technical_language>

Target:
protected boolean removeMemoryVolumes(String memVols, VdcActionType parentCommand, boolean startPollingTasks) { List<Guid> guids = GuidUtils.getGuidListFromString(memVols); if (guids.size() == 6) { boolean isDiskWithWipeAfterDeleteExist = MemoryImageRemover.isDiskWithWipeAfterDeleteExist(getDiskDao().getAllForVm(getVm().getId())); StorageType storageType = getStorageDomainDAO().get( MemoryImageRemover.getStorageDomainId(guids)).getStorageType(); boolean postZero = ImagesHandler.shouldWipeAfterDelete(isDiskWithWipeAfterDeleteExist, storageType); Guid taskId1 = persistAsyncTaskPlaceHolder(parentCommand, DELETE_PRIMARY_IMAGE_TASK_KEY); VDSReturnValue vdsRetValue = runVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(guids.get(1), guids.get(0), guids.get(2), postZero, false)); if (!vdsRetValue.getSucceeded()) { return false; } Guid guid1 = createTask(taskId1, vdsRetValue.getCreationInfo(), parentCommand, VdcObjectType.Storage, guids.get(0)); getTaskIdList().add(guid1); Guid taskId2 = persistAsyncTaskPlaceHolder(parentCommand, DELETE_SECONDARY_IMAGES_TASK_KEY); vdsRetValue = runVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(guids.get(1), guids.get(0), guids.get(4), postZero, false)); if (!vdsRetValue.getSucceeded()) { if (startPollingTasks) { TaskManagerUtil.startPollingTask(guid1); } return false; } Guid guid2 = createTask(taskId2, vdsRetValue.getCreationInfo(), parentCommand); getTaskIdList().add(guid2); if (startPollingTasks) { TaskManagerUtil.startPollingTask(guid1); TaskManagerUtil.startPollingTask(guid2); } } return true; }