Source:
protected boolean validate() { if (!super.validate() || !initializeVds() || !checkStorageDomainNameLengthValid()) { return false; } if (isStorageWithSameNameExists()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST); } if (getStorageDomain().getStorageDomainType() == StorageDomainType.ISO && !getStorageDomain().getStorageType().isFileDomain()) { addValidationMessageVariable("domainType", StorageConstants.ISO); addValidationMessageVariable("storageTypes", StorageConstants.FILE); return failValidation(EngineMessage.ACTION_TYPE_FAILED_DOMAIN_TYPE_CAN_BE_CREATED_ONLY_ON_SPECIFIC_STORAGE_DOMAINS); } if (getStorageDomain().getStorageDomainType() == StorageDomainType.ImportExport && getStorageDomain().getStorageType().isBlockDomain()) { addValidationMessageVariable("domainType", StorageConstants.EXPORT); addValidationMessageVariable("storageTypes", StorageConstants.FILE); return failValidation(EngineMessage.ACTION_TYPE_FAILED_DOMAIN_TYPE_CAN_BE_CREATED_ONLY_ON_SPECIFIC_STORAGE_DOMAINS); } if (getStorageDomain().getStorageDomainType() == StorageDomainType.Master) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL); } ensureStorageFormatInitialized(); StorageDomainToPoolRelationValidator storageDomainToPoolRelationValidator = getAttachDomainValidator(); StorageDomainValidator sdValidator = getStorageDomainValidator(); if (!validate(storageDomainToPoolRelationValidator.isStorageDomainFormatCorrectForDC()) || !validate(sdValidator.isStorageFormatCompatibleWithDomain())) { return false; } initStorageDomainDiscardAfterDeleteIfNeeded(); if (!validateDiscardAfterDeleteLegal(sdValidator)) { return false; } return canAddDomain(); }

Target:
protected boolean validate() { if (!super.validate() || !initializeVds() || !checkStorageDomainNameLengthValid()) { return false; } if (isStorageWithSameNameExists()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST); } if (getStorageDomain().getStorageDomainType() == StorageDomainType.ISO && !getStorageDomain().getStorageType().isFileDomain()) { addValidationMessageVariable("domainType", StorageConstants.ISO); addValidationMessageVariable("storageTypes", StorageConstants.FILE); return failValidation(EngineMessage.ACTION_TYPE_FAILED_DOMAIN_TYPE_CAN_BE_CREATED_ONLY_ON_SPECIFIC_STORAGE_DOMAINS); } if (getStorageDomain().getStorageDomainType() == StorageDomainType.ImportExport && getStorageDomain().getStorageType().isBlockDomain()) { addValidationMessageVariable("domainType", StorageConstants.EXPORT); addValidationMessageVariable("storageTypes", StorageConstants.FILE); return failValidation(EngineMessage.ACTION_TYPE_FAILED_DOMAIN_TYPE_CAN_BE_CREATED_ONLY_ON_SPECIFIC_STORAGE_DOMAINS); } if (getStorageDomain().getStorageDomainType() == StorageDomainType.Master) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL); } ensureStorageFormatInitialized(); StorageDomainValidator sdValidator = getStorageDomainValidator(); if (!validate(sdValidator.isStorageFormatCompatibleWithDomain())) { return false; } initStorageDomainDiscardAfterDeleteIfNeeded(); if (!validateDiscardAfterDeleteLegal(sdValidator)) { return false; } return canAddDomain(); }