Change in vdsm[ovirt-3.3]: image: use successor volume size when merging

fsimonce at redhat.com fsimonce at redhat.com
Tue Aug 13 13:42:27 UTC 2013


Hello Eduardo,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/18025

to review the following change.

Change subject: image: use successor volume size when merging
......................................................................

image: use successor volume size when merging

Volumes in the same image chain might have different capacity since the
introduction of the disk resize feature. This means that when we merge
volumes the ancestor should get the new size from the successor in order
to be able to contain the additional data that we are collapsing.

Change-Id: Ic0bfd2ffa080bf89709ae543043b52aad27eb759
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/17093
Reviewed-by: Eduardo <ewarszaw at redhat.com>
---
M vdsm/storage/image.py
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/18025/1

diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 2a9510d..9aa8fc7 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -1000,7 +1000,7 @@
             # destination volume's parent parameters
             newUUID = srcVol.volUUID + "_MERGE"
             sdDom.createVolume(
-                imgUUID=srcVolParams['imgUUID'], size=volParams['size'],
+                imgUUID=srcVolParams['imgUUID'], size=srcVolParams['size'],
                 volFormat=volParams['volFormat'],
                 preallocate=volParams['prealloc'],
                 diskType=volParams['disktype'], volUUID=newUUID,
@@ -1111,6 +1111,11 @@
         reqSize = min(accSize, imageApparentSize) * 1.1
         try:
             # Start the actual merge image procedure
+            # IMPORTANT NOTE: volumes in the same image chain might have
+            # different capacity since the introduction of the disk resize
+            # feature. This means that when we merge volumes the ancestor
+            # should get the new size from the successor (in order to be
+            # able to contain the additional data that we are collapsing).
             if dstParentUUID != sd.BLANK_UUID:
                 # The ancestor isn't a base volume of the chain.
                 self.log.info("Internal volume merge: src = %s dst = %s",


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0bfd2ffa080bf89709ae543043b52aad27eb759
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>


More information about the vdsm-patches mailing list