Tal Nisan has uploaded a new change for review. Change subject: core: Remove LSM in different storage sub types limitation [WIP] ......................................................................
core: Remove LSM in different storage sub types limitation [WIP] Change-Id: Ic5cbf6b7e3fd14af3dc22fca2469ba43ec6a4353 Signed-off-by: Tal Nisan <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommand.java M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommandTest.java 2 files changed, 1 insertion(+), 46 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/19/37019/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommand.java index 3d5cb9e..4f7e7aa 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommand.java @@ -332,21 +332,13 @@ StorageDomain destDomain = getStorageDomainById(parameters.getTargetStorageDomainId(), getStoragePoolId()); return validateSourceStorageDomain(sourceDomain) - && validateDestStorage(destDomain) - && validateDestStorageAndSourceStorageOfSameTypes(destDomain, sourceDomain); + && validateDestStorage(destDomain); } private StorageDomain getImageSourceDomain(Guid imageId) { DiskImage diskImage = getDiskImageByImageId(imageId); Guid domainId = diskImage.getStorageIds().get(0); return getStorageDomainById(domainId, getStoragePoolId()); - } - - private boolean validateDestStorageAndSourceStorageOfSameTypes(StorageDomain destDomain, StorageDomain sourceDomain) { - if (destDomain.getStorageType().getStorageSubtype() != sourceDomain.getStorageType().getStorageSubtype()) { - return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DESTINATION_AND_SOURCE_STORAGE_SUB_TYPES_DIFFERENT); - } - return true; } private boolean isValidParametersList() { diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommandTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommandTest.java index 6849d64..03e690d 100644 --- a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommandTest.java +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommandTest.java @@ -237,43 +237,6 @@ } @Test - public void canDoActionInvalidFileToBlock() { - canDoActionInvalidDestinationAndSourceDomainOfDifferentStorageSubtypes(StorageType.NFS, StorageType.ISCSI, false); - } - - @Test - public void canDoActionInvalidBlockToFile() { - canDoActionInvalidDestinationAndSourceDomainOfDifferentStorageSubtypes(StorageType.ISCSI, StorageType.NFS, false); - } - - @Test - public void canDoActionBlockToBlock() { - canDoActionInvalidDestinationAndSourceDomainOfDifferentStorageSubtypes(StorageType.ISCSI, StorageType.ISCSI, true); - } - - private void canDoActionInvalidDestinationAndSourceDomainOfDifferentStorageSubtypes(StorageType sourceType, StorageType destType, boolean shouldSucceed) { - createParameters(); - - StorageDomain srcStorageDomain = initStorageDomain(srcStorageId); - srcStorageDomain.setStatus(StorageDomainStatus.Active); - srcStorageDomain.setStorageType(sourceType); - - StorageDomain dstStorageDomain = initStorageDomain(dstStorageId); - dstStorageDomain.setStatus(StorageDomainStatus.Active); - dstStorageDomain.setStorageType(destType); - - initDiskImage(diskImageGroupId, diskImageId); - initVm(VMStatus.Up, Guid.newGuid(), diskImageGroupId); - - assertEquals(command.canDoAction(), shouldSucceed); - if (!shouldSucceed) { - assertTrue(command.getReturnValue() - .getCanDoActionMessages() - .contains(VdcBllMessages.ACTION_TYPE_FAILED_DESTINATION_AND_SOURCE_STORAGE_SUB_TYPES_DIFFERENT.toString())); - } - } - - @Test public void canDoActionVmRunningStateless() { createParameters(); initDiskImage(diskImageGroupId, diskImageId); -- To view, visit http://gerrit.ovirt.org/37019 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic5cbf6b7e3fd14af3dc22fca2469ba43ec6a4353 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tal Nisan <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
