Allon Mureinik has posted comments on this change.

Change subject: core: Calculate storage format when adding an SD
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.ovirt.org/#/c/30960/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddStorageDomainCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddStorageDomainCommand.java:

Line 164:         if (sd.getStorageFormat() == null) {
Line 165:             if (sd.getStorageDomainType().isDataDomain()) {
Line 166:                 
sd.setStorageFormat(VersionStorageFormatUtil.getPreferredForVersion(
Line 167:                         
getTargetStoragePool().getcompatibility_version(), sd.getStorageType())
Line 168:                 );
> I have the feeling that we have some cases where getTargetStoragePool() cou
It can't be null.

If no pool is assigned to the SD, the pool (=dc) is taken from the host.
since a host must be part of cluster, and a cluster must be part of a dc, this 
is guarenteed to be not-null
Line 169:             } else {
Line 170:                 sd.setStorageFormat(StorageFormatType.V1);
Line 171:             }
Line 172:         }


http://gerrit.ovirt.org/#/c/30960/3/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/AddStorageDomainCommonTest.java
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/AddStorageDomainCommonTest.java:

Line 116:         sd.setStorageFormat(null);
Line 117:         CanDoActionTestUtils.runAndAssertCanDoActionSuccess(cmd);
Line 118:         assertEquals("Format not initialized correctly", 
StorageFormatType.V3, sd.getStorageFormat());
Line 119:     }
Line 120: 
> I think we miss something like:
Good idea - will add it
Line 121:     @Test
Line 122:     public void canDoActionSucceedsInitFormatIsoDomain() {
Line 123:         sd.setStorageFormat(null);
Line 124:         sd.setStorageDomainType(StorageDomainType.ISO);


-- 
To view, visit http://gerrit.ovirt.org/30960
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If469bb655e9a65e2d0afcee164655fa0bdfa5d99
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to