Change in vdsm[master]: [wip] upgrade: handle the template lease files

fsimonce at redhat.com fsimonce at redhat.com
Sat Sep 29 10:19:15 UTC 2012


Federico Simoncelli has uploaded a new change for review.

Change subject: [wip] upgrade: handle the template lease files
......................................................................

[wip] upgrade: handle the template lease files

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=855425
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
Change-Id: I886f887438220e61f8764fc3d32d7b99609d8543
---
M vdsm/storage/imageRepository/formatConverter.py
1 file changed, 12 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/8271/1

diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py
index f0fb962..21a6c1c 100644
--- a/vdsm/storage/imageRepository/formatConverter.py
+++ b/vdsm/storage/imageRepository/formatConverter.py
@@ -120,7 +120,7 @@
                      "%s", vol.volUUID, metaVolSize, virtVolSize)
             vol.setMetaParam(volume.SIZE, str(virtVolSize))
 
-    def v3UpdateVolume(vol):
+    def v3UpdateVolume(imgUUID, vol):
         log.debug("Changing permissions (read-write) for the "
                   "volume %s", vol.volUUID)
 
@@ -130,7 +130,16 @@
 
         log.debug("Creating the volume lease for %s", vol.volUUID)
         metaId = vol.getMetadataId()
-        type(vol).newVolumeLease(metaId, vol.sdUUID, vol.volUUID)
+        realImgUUID = vol.getImage()
+
+        if vol.isShared() and imgUUID != realImgUUID:
+            # TODO: fix this to use vol.imagePath
+            imgPath = image.Image(vol.repoPath) \
+                           .getImageDir(domain.sdUUID, imgUUID)
+            volParent = domain.produceVolume(realImgUUID, vol.volUUID)
+            volParent.share(imgPath)
+        else:
+            type(vol).newVolumeLease(metaId, vol.sdUUID, vol.volUUID)
 
     try:
         if isMsd:
@@ -169,7 +178,7 @@
 
             try:
                 for vol in volChain:
-                    v3UpdateVolume(vol)
+                    v3UpdateVolume(imgUUID, vol)
                     v3ResetMetaVolSize(vol)  # BZ#811880
             finally:
                 try:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I886f887438220e61f8764fc3d32d7b99609d8543
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>


More information about the vdsm-patches mailing list