Arik Hadas has uploaded a new change for review. Change subject: core: change import vm to be VmCommand - part 1 ......................................................................
core: change import vm to be VmCommand - part 1 This patch reduces the coupling between ImportVmCommand and MoveOrCopyTemplateCommand command by replacing calls to methods that always return the same constants with the constant values. Change-Id: I77c044c25246ebd2fb6e5b9999bfbe2267ab3cbe Signed-off-by: Arik Hadas <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/34985/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java index 8f75af0..473e09a 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java @@ -51,6 +51,7 @@ import org.ovirt.engine.core.common.businessentities.DiskInterface; import org.ovirt.engine.core.common.businessentities.Entities; import org.ovirt.engine.core.common.businessentities.ImageDbOperationScope; +import org.ovirt.engine.core.common.businessentities.ImageOperation; import org.ovirt.engine.core.common.businessentities.Snapshot; import org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus; import org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType; @@ -782,7 +783,7 @@ private MoveOrCopyImageGroupParameters buildMoveOrCopyImageGroupParametersForMemoryDumpImage(Guid containerID, Guid storageId, Guid imageId, Guid volumeId) { MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(containerID, - imageId, volumeId, imageId, volumeId, storageId, getMoveOrCopyImageOperation()); + imageId, volumeId, imageId, volumeId, storageId, ImageOperation.Copy); params.setParentCommand(getActionType()); params.setCopyVolumeType(CopyVolumeType.LeafVol); params.setForceOverride(getParameters().getForceOverride()); @@ -805,7 +806,7 @@ private MoveOrCopyImageGroupParameters buildMoveOrCopyImageGroupParametersForMemoryConfImage(Guid containerID, Guid storageId, Guid imageId, Guid volumeId) { MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(containerID, - imageId, volumeId, imageId, volumeId, storageId, getMoveOrCopyImageOperation()); + imageId, volumeId, imageId, volumeId, storageId, ImageOperation.Copy); params.setParentCommand(getActionType()); // This volume is always of type 'sparse' and format 'cow' so no need to convert, // and there're no snapshots for it so no reason to use copy collapse @@ -843,7 +844,7 @@ newDiskIdForDisk.get(disk.getId()).getImageId(), disk.getId(), disk.getImageId(), - destinationDomain, getMoveOrCopyImageOperation()); + destinationDomain, ImageOperation.Copy); params.setParentCommand(getActionType()); params.setUseCopyCollapse(getParameters().getCopyCollapse()); params.setCopyVolumeType(CopyVolumeType.LeafVol); @@ -1205,7 +1206,7 @@ protected void endActionOnAllImageGroups() { for (VdcActionParametersBase p : getParameters().getImagesParameters()) { p.setTaskGroupSuccess(getParameters().getTaskGroupSuccess()); - getBackend().endAction(getImagesActionType(), + getBackend().endAction(VdcActionType.CopyImageGroup, p, getContext().clone().withoutCompensationContext().withoutExecutionContext().withoutLock()); } -- To view, visit http://gerrit.ovirt.org/34985 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77c044c25246ebd2fb6e5b9999bfbe2267ab3cbe Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
