Source:
<code>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(); <START> StorageDomainToPoolRelationValidator storageDomainToPoolRelationValidator = getAttachDomainValidator(); StorageDomainValidator sdValidator = getStorageDomainValidator(); if (!validate(storageDomainToPoolRelationValidator.isStorageDomainFormatCorrectForDC()) || <END> !validate(sdValidator.isStorageFormatCompatibleWithDomain())) { return false; } initStorageDomainDiscardAfterDeleteIfNeeded(); if (!validateDiscardAfterDeleteLegal(sdValidator)) { return false; } return canAddDomain(); }</code><technical_language>of this remove - attaching domain pool in this command, we? - removed previous validation, getSotagePool() return null, in case this fail NPE</technical_language>

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(); }