Change in vdsm[ovirt-3.4]: Allow moving of sparse images to a block domains
tnisan at redhat.com
tnisan at redhat.com
Sun Apr 6 15:07:42 UTC 2014
Hello Federico Simoncelli, Dan Kenigsberg, Allon Mureinik,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/26469
to review the following change.
Change subject: Allow moving of sparse images to a block domains
......................................................................
Allow moving of sparse images to a block domains
When attempting to move a sparse image from a file domain to a block domain
the destination image is created as sparse which is not supported on block
domains.
This patch allows to create the images preallocated on domains that do not
support sparseness
Change-Id: Id95d700cf6acb46464d6c5d063966f9331a15028
Signed-off-by: Tal Nisan <tnisan at redhat.com>
Bug-Url: https://bugzilla.redhat.com/1063996
Reviewed-on: http://gerrit.ovirt.org/25778
Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
Reviewed-by: Allon Mureinik <amureini at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/storage/image.py
1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/69/26469/1
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index a24bcc3..637d4c8 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -358,11 +358,10 @@
# we create the target as a sparse volume (since it will be
# soon filled with the data coming from the copy) and then
# we change its metadata back to the original value.
- if (volParams['prealloc'] == volume.PREALLOCATED_VOL
- and destDom.supportsSparseness):
+ if destDom.supportsSparseness:
tmpVolPreallocation = volume.SPARSE_VOL
else:
- tmpVolPreallocation = volParams['prealloc']
+ tmpVolPreallocation = volume.PREALLOCATED_VOL
destDom.createVolume(imgUUID=imgUUID,
size=volParams['size'],
@@ -380,10 +379,12 @@
# Extend volume (for LV only) size to the actual size
dstVol.extend((volParams['apparentsize'] + 511) / 512)
- # Change destination volume metadata back to the original
- # type.
- if tmpVolPreallocation != volParams['prealloc']:
- dstVol.setType(volParams['prealloc'])
+ # Change destination volume metadata to preallocated in
+ # case we've used a sparse volume to accelerate the
+ # volume creation
+ if volParams['prealloc'] == volume.PREALLOCATED_VOL \
+ and tmpVolPreallocation != volume.PREALLOCATED_VOL:
+ dstVol.setType(volume.PREALLOCATED_VOL)
dstChain.append(dstVol)
except se.StorageException:
--
To view, visit http://gerrit.ovirt.org/26469
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id95d700cf6acb46464d6c5d063966f9331a15028
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
More information about the vdsm-patches
mailing list