Change in vdsm[ovirt-3.3]: image: produce volume in order to shrink after merge
ykaplan at redhat.com
ykaplan at redhat.com
Tue Oct 8 11:18:35 UTC 2013
Hello Ayal Baron,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/19983
to review the following change.
Change subject: image: produce volume in order to shrink after merge
......................................................................
image: produce volume in order to shrink after merge
Create of new volume in case of raw base volume,
causes us to work on a stale object when shrinking
the merged volume.
Change-Id: I5b0969c3144b51ff22a7f5eb756563cf178ffb36
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1015071
Signed-off-by: Yeela Kaplan <ykaplan at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19883
Reviewed-by: Ayal Baron <abaron at redhat.com>
---
M vdsm/storage/image.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/19983/1
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index da3e42d..08eca25 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -1002,8 +1002,8 @@
# Step 3: Rename successor as to _remove_me__successor
tmpUUID = self.deletedVolumeName(srcVol.volUUID)
- # Step 4: Rename successor_MERGE to successor
srcVol.rename(tmpUUID)
+ # Step 4: Rename successor_MERGE to successor
newVol.rename(srcVolParams['volUUID'])
# Step 5: Rebase children 'unsafely' on top of new volume
@@ -1132,8 +1132,10 @@
self.log.error("Failure to remove subchain %s -> %s in image %s",
ancestor, successor, imgUUID, exc_info=True)
+ newVol = sdDom.produceVolume(imgUUID=srcVolParams['imgUUID'],
+ volUUID=srcVolParams['volUUID'])
try:
- srcVol.shrinkToOptimalSize()
+ newVol.shrinkToOptimalSize()
except qemuImg.QImgError:
self.log.warning("Auto shrink after merge failed", exc_info=True)
--
To view, visit http://gerrit.ovirt.org/19983
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b0969c3144b51ff22a7f5eb756563cf178ffb36
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
More information about the vdsm-patches
mailing list