Source:
protected boolean canDoActionBeforeCloneVm(Map<Guid, StorageDomain> domainsMap) { if (getVm() != null) { setDescription(getVmName()); } if (getStoragePool() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST); } Set<Guid> destGuids = new HashSet<>(imageToDestinationDomainMap.values()); for (Guid destGuid : destGuids) { StorageDomain storageDomain = getStorageDomain(destGuid); StorageDomainValidator validator = new StorageDomainValidator(storageDomain); if (!validate(validator.isDomainExistAndActive()) || !validate(validator.domainIsValidDestination())) { return false; } domainsMap.put(destGuid, storageDomain); } if (!isImagesAlreadyOnTarget() && getParameters().isImportAsNewEntity() && !getParameters().getCopyCollapse()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_CLONE_NOT_COLLAPSED); } if (isImagesAlreadyOnTarget() && getParameters().getCopyCollapse()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_UNREGISTERED_NOT_COLLAPSED); } if (!isImagesAlreadyOnTarget()) { setSourceDomainId(getParameters().getSourceDomainId()); StorageDomainValidator validator = new StorageDomainValidator(getSourceDomain()); if (validator.isDomainExistAndActive().isValid() && getSourceDomain().getStorageDomainType() != StorageDomainType.ImportExport) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL); } if (!validateAndSetVmFromExportDomain()) return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND_ON_EXPORT_DOMAIN); } if (!validateImages(domainsMap)) { return false; } return true; }

Target:
protected boolean canDoActionBeforeCloneVm(Map<Guid, StorageDomain> domainsMap) { if (getVm() != null) { setDescription(getVmName()); } if (getStoragePool() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST); } Set<Guid> destGuids = new HashSet<>(imageToDestinationDomainMap.values()); for (Guid destGuid : destGuids) { StorageDomain storageDomain = getStorageDomain(destGuid); StorageDomainValidator validator = new StorageDomainValidator(storageDomain); if (!validate(validator.isDomainExistAndActive()) || !validate(validator.domainIsValidDestination())) { return false; } domainsMap.put(destGuid, storageDomain); } if (!isImagesAlreadyOnTarget() && getParameters().isImportAsNewEntity() && !getParameters().getCopyCollapse()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_CLONE_NOT_COLLAPSED); } if (isImagesAlreadyOnTarget() && getParameters().getCopyCollapse()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_UNREGISTERED_NOT_COLLAPSED); } if (!isImagesAlreadyOnTarget()) { setSourceDomainId(getParameters().getSourceDomainId()); StorageDomainValidator validator = new StorageDomainValidator(getSourceDomain()); if (validator.isDomainExistAndActive().isValid() && getSourceDomain().getStorageDomainType() != StorageDomainType.ImportExport) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL); } if (!validateAndSetVmFromExportDomain()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND_ON_EXPORT_DOMAIN); } } if (!validateImages(domainsMap)) { return false; } return true; }