Daniel Erez has uploaded a new change for review.

Change subject: core: delete connections on block domain removal
......................................................................

core: delete connections on block domain removal

When removing a block storage domain, the relevant connections must
be removed from the DB before removing the corresponding luns
(as we can't retrieve connections by VG without the luns).

Change-Id: If1be645779e5ad28e9c2672246e6e68d5aecb00e
Bug-Url: https://bugzilla.redhat.com/1011569
Signed-off-by: Daniel Erez <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java
1 file changed, 5 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/53/19753/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java
index b799dc6..2ae514b 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java
@@ -192,14 +192,12 @@
 
     @Override
     public boolean storageDomainRemoved(StorageDomainStatic storageDomain) {
-        int numOfRemovedLuns = removeStorageDomainLuns(storageDomain);
-        if (numOfRemovedLuns > 0) {
-            List<StorageServerConnections> list = DbFacade.getInstance()
-                    
.getStorageServerConnectionDao().getAllForVolumeGroup(storageDomain.getStorage());
-            for (StorageServerConnections connection : 
FilterConnectionsUsedByOthers(list, storageDomain.getStorage())) {
-                
DbFacade.getInstance().getStorageServerConnectionDao().remove(connection.getid());
-            }
+        List<StorageServerConnections> list = DbFacade.getInstance()
+                
.getStorageServerConnectionDao().getAllForVolumeGroup(storageDomain.getStorage());
+        for (StorageServerConnections connection : 
FilterConnectionsUsedByOthers(list, storageDomain.getStorage())) {
+            
DbFacade.getInstance().getStorageServerConnectionDao().remove(connection.getid());
         }
+        removeStorageDomainLuns(storageDomain);
         return true;
     }
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1be645779e5ad28e9c2672246e6e68d5aecb00e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to