Federico Simoncelli has uploaded a new change for review.

Change subject: hsm: [wip] protect deleteImage with the spm lock
......................................................................

hsm: [wip] protect deleteImage with the spm lock

Change-Id: Iac5b4b0f71de6a12de34513d4fafb295b701306c
Signed-off-by: Federico Simoncelli <fsimo...@redhat.com>
---
M vdsm/storage/hsm.py
M vdsm/storage/sp.py
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/95/19795/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 4f5a8a7..c4350d6 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1506,7 +1506,7 @@
         force parameter is deprecated and not evaluated.
         """
         # vars.task.setDefaultException(se.ChangeMeError("%s" % args))
-        self.getPool(spUUID)  # Validates that the pool is connected. WHY?
+        pool = self.getPool(spUUID)  # Validates pool connection. WHY?
         dom = sdCache.produce(sdUUID=sdUUID)
 
         vars.task.getExclusiveLock(STORAGE, imgUUID)
@@ -1541,7 +1541,7 @@
             if fakeTUUID:
                 tParams = dom.produceVolume(imgUUID, fakeTUUID).\
                     getVolumeParams()
-            dom.deleteImage(sdUUID, imgUUID, volsByImg)
+            pool.deleteImage(dom, imgUUID, volsByImg)
             # This is a hack to keep the interface consistent
             # We currently have race conditions in delete image, to quickly fix
             # this we delete images in the "synchronous" state. This only works
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 8bab500..7242006 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -2020,6 +2020,12 @@
                 sdCache.produce(sdUUID).produceVolume(imgUUID, volUUID).delete(
                     postZero=postZero, force=force)
 
+    def deleteImage(self, domain, imgUUID, volsByImg):
+        """
+        TODO: describe method
+        """
+        domain.deleteImage(domain.sdUUID, imgUUID, volsByImg)
+
     def setMaxHostID(self, spUUID, maxID):
         """
         Set maximum host ID


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac5b4b0f71de6a12de34513d4fafb295b701306c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimo...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to