Allon Mureinik has posted comments on this change.

Change subject: engine: StorageConnections ops won't assume VDS/SP
......................................................................


Patch Set 4: (8 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddStorageServerConnectionCommand.java
Line 31: 
Line 32:     @Override
Line 33:     protected void executeCommand() {
Line 34:         boolean success = true;
Line 35:         StorageServerConnections connection = getConnection();
Done
Line 36: 
Line 37:         // Attempt to connect only if a host is given.
Line 38:         // If not, just save the connection to the database
Line 39:         if (!Guid.isNullOrEmpty(getParameters().getVdsId())) {


Line 51: 
Line 52:         if (success) {
Line 53:             connection.setid(Guid.newGuid().toString());
Line 54:             saveConnection(connection);
Line 55:             
getReturnValue().setActionReturnValue(getConnection().getid());
Done
Line 56:         }
Line 57: 
Line 58:         setSucceeded(success);
Line 59:     }


Line 102:         if (isConnWithSameDetailsExists(paramConnection)) {
Line 103:             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS);
Line 104:         }
Line 105: 
Line 106:         if (!Guid.isNullOrEmpty(getParameters().getVdsId())) {
The CDA is supposed to return true - the meaning of this patch is that we allow 
it.
Not sure we're on the same page here - please elaborate
Line 107:             if (getVds() == null) {
Line 108:                 return 
failCanDoAction(VdcBllMessages.VDS_INVALID_SERVER_ID);
Line 109:             }
Line 110:             if (getVds().getStatus() != VDSStatus.Up) {


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DisconnectStorageServerConnectionCommand.java
Line 30:                     VDSCommandType.DisconnectStorageServer,
Line 31:                        new 
StorageServerConnectionManagementVDSParameters(getParameters().getVdsId(), 
Guid.Empty,
Line 32:                                
getParameters().getStorageServerConnection().getstorage_type(),
Line 33:                                new ArrayList<>(Arrays
Line 34:                                        .asList(new 
StorageServerConnections[]{getConnection()})))).getSucceeded();
Left the preexisting formatting, just changed this call
Line 35:     }
Line 36: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStorageServerConnectionCommand.java
Line 190:     }
Line 191: 
Line 192:     @Override
Line 193:     protected void executeCommand() {
Line 194:         boolean isDomainUpdatePossible = 
!Guid.isNullOrEmpty(getVdsId());
Done
Line 195:         boolean isDomainUpdateRequired = isDomainUpdatePossible && 
doDomainsUseConnection(getConnection());
Line 196:         List<StorageDomain> updatedDomains = new ArrayList<>();
Line 197:         boolean hasConnectStorageSucceeded = false;
Line 198:         if (isDomainUpdateRequired) {


Line 216:         }
Line 217:         
getStorageConnDao().update(getParameters().getStorageServerConnection());
Line 218:         if (isDomainUpdateRequired) {
Line 219:             for (StorageDomain domain : domains) {
Line 220:                 for (StoragePoolIsoMap map : 
getStoragePoolIsoMap(domain)) {
There arne't any races here - this is only done on domains in maintenance.
Anyway, added in updateStatus
Line 221:                     restoreStateAfterUpdate(map);
Line 222:                 }
Line 223:             }
Line 224:             if (hasConnectStorageSucceeded) {


Line 243:         return !getLuns().isEmpty();
Line 244:     }
Line 245: 
Line 246:     protected Collection<StoragePoolIsoMap> 
getStoragePoolIsoMap(StorageDomain storageDomain) {
Line 247:         return 
getStoragePoolIsoMapDao().getAllForStorage(storageDomain.getId());
It's done in a loop, on a different domain each time.
Caching will be messy.

If we see it's a performance issue, we'll add it in a sepatate patch.
Line 248:     }
Line 249: 
Line 250:     protected void changeStorageDomainStatusInTransaction(final 
StorageDomainStatus status) {
Line 251:         executeInNewTransaction(new TransactionMethod<Void>() {


Line 257:                         context.snapshotEntityStatus(map, 
map.getstatus());
Line 258:                         updateStatus(map, status);
Line 259:                     }
Line 260:                 }
Line 261:                 getCompensationContext().stateChanged();
I answered this last patchset - I agree with the idea, but not in the scope of 
this patchset.
Line 262:                 return null;
Line 263:             }
Line 264:         });
Line 265:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I628bf2a63f64d3acaa3520ad144e1eef744f1204
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to