Liron Ar has posted comments on this change.

Change subject: core: add the domain detaching state
......................................................................


Patch Set 5:

(4 comments)

http://gerrit.ovirt.org/#/c/23556/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DetachStorageDomainFromPoolCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DetachStorageDomainFromPoolCommand.java:

Line 60:                 getCompensationContext().snapshotEntity(mapToRemove);
Line 61:                 DbFacade.getInstance()
Line 62:                         .getStoragePoolIsoMapDao()
Line 63:                         .remove(new 
StoragePoolIsoMapId(mapToRemove.getstorage_id(),
Line 64:                                 mapToRemove.getstorage_pool_id()));
this line will "detach" the domain from the pool, so currently the behavior 
isn't changed as intended.
Line 65:                 getCompensationContext().stateChanged();
Line 66:                 return null;
Line 67:             }
Line 68:         });


http://gerrit.ovirt.org/#/c/23556/5/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/StoragePoolDomainHelper.java
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/StoragePoolDomainHelper.java:

Line 16:         for (StoragePoolIsoMap domain : storagePoolIsoMaps) {
Line 17:             if (domain.getStatus() == StorageDomainStatus.Maintenance
Line 18:                     || domain.getStatus() == 
StorageDomainStatus.PreparingForMaintenance) {
Line 19:                 storageDomains.put(domain.getstorage_id().toString(), 
"attached");
Line 20:             } else if (domain.getStatus() != 
StorageDomainStatus.Detaching) {
I'd prefer "early" if here:
if (domain.getStatus() == StorageDomainStatus.Detaching) {
continue;
}

if..
Line 21:                 storageDomains.put(domain.getstorage_id().toString(),
Line 22:                         
StorageDomainStatus.Active.toString().toLowerCase());
Line 23:             }
Line 24:         }


http://gerrit.ovirt.org/#/c/23556/5/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java:

Line 479:             return ((storage.getStorageDomainType() == 
StorageDomainType.Data
Line 480:                     || storage.getStorageDomainType() == 
StorageDomainType.Master)
Line 481:                         && (storage.getStatus() == 
StorageDomainStatus.Maintenance
Line 482:                             || storage.getStatus() == 
StorageDomainStatus.PreparingForMaintenance
Line 483:                             || storage.getStatus() == 
StorageDomainStatus.Detaching
It shouldn't be allowed while the domain is being detached (or being moved to 
maintenance)
Line 484:                             || storage.getStorageDomainSharedStatus() 
== StorageDomainSharedStatus.Unattached));
Line 485:         }
Line 486:         return false;
Line 487:     }


Line 1156:                 || storageDomain.getStorageDomainSharedStatus() == 
StorageDomainSharedStatus.Mixed;
Line 1157:         boolean isInMaintenance = (storageDomain.getStatus() == 
StorageDomainStatus.Maintenance
Line 1158:                 || storageDomain.getStatus() == 
StorageDomainStatus.PreparingForMaintenance);
Line 1159:         boolean isUnattached = 
(storageDomain.getStorageDomainSharedStatus() == 
StorageDomainSharedStatus.Unattached
Line 1160:                 || storageDomain.getStatus() == 
StorageDomainStatus.Detaching);
same
Line 1161:         boolean isDataDomain = (storageDomain.getStorageDomainType() 
== StorageDomainType.Data) || (storageDomain.getStorageDomainType() == 
StorageDomainType.Master);
Line 1162:         boolean isBlockStorage = 
storageDomain.getStorageType().isBlockDomain();
Line 1163: 
Line 1164:         isEditAvailable = isActive || isBlockStorage || 
((isInMaintenance || isUnattached) && isDataDomain);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5732ef00a67ef1381ee0b6f29d08ab39cf63a1bf
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimo...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Ayal Baron <aba...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com>
Gerrit-Reviewer: Liron Ar <lara...@redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to