Yaniv Bronhaim has uploaded a new change for review.

Change subject: prepare volume instead of prepare blockSD
......................................................................

prepare volume instead of prepare blockSD

Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=851837

change the call of activateVolume to llprepare volume, and
teardown instead of deactiveVolume, which sperates lv
syscall operation to only verifies that the lv is in used as
part of the volume. If the sd is in use by the checked volume,
we want to keep ref counter to sign this volume, and when we
teardown it, we verify that there are no references to the same
sd before deactivate it.

Change-Id: I25b9c260a7de5f883420a5322f90195b3379e80e
Signed-off-by: Yaniv Bronhaim <[email protected]>
---
M vdsm/storage/image.py
1 file changed, 2 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/8050/1

diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index d004046..97112dc 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -383,8 +383,7 @@
             chain.insert(0, tmplVolume)
 
         # Activating the volumes
-        sdCache.produce(sdUUID).activateVolumes(
-                    volUUIDs=[vol.volUUID for vol in chain])
+        sdCache.produce(sdUUID).llPrepare()
 
         return chain
 
@@ -392,11 +391,8 @@
         chain = self.getChain(sdUUID, imgUUID, volUUID)
 
         # Deactivating the volumes
-        sdCache.produce(sdUUID).deactivateVolumes(
-                    volUUIDs=[vol.volUUID for vol in chain])
-
         # Do not deactivate the template yet (might be in use by an other vm)
-        # TODO: reference counting to deactivate when unused
+        sdCache.produce(sdUUID).teardown(sdUUID, volUUIDs=[vol.volUUID for vol 
in chain])                
 
     def __templateRelink(self, destDom, imgUUID, volUUID):
         """


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25b9c260a7de5f883420a5322f90195b3379e80e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to