Change in vdsm[master]: Allow moving of sparse images to a block domains

Federico Simoncelli fsimonce at redhat.com
Wed Mar 19 09:12:04 UTC 2014


Federico Simoncelli has posted comments on this change.

Change subject: Allow moving of sparse images to a block domains
......................................................................


Patch Set 3: Code-Review-1

(2 comments)

http://gerrit.ovirt.org/#/c/25778/3/vdsm/storage/image.py
File vdsm/storage/image.py:

Line 363:                             tmpVolPreallocation = volume.SPARSE_VOL
Line 364:                         else:
Line 365:                             tmpVolPreallocation = volParams['prealloc']
Line 366:                     else:
Line 367:                         tmpVolPreallocation = volume.PREALLOCATED_VOL
I have the feeling that the entire thing could be simplified to:

 if destDom.supportsSparseness:
     tmpVolPreallocation = volume.SPARSE_VOL
 else:
     tmpVolPreallocation = volume.PREALLOCATED_VOL
Line 368: 
Line 369:                     destDom.createVolume(imgUUID=imgUUID,
Line 370:                                          size=volParams['size'],
Line 371:                                          volFormat=volParams['volFormat'],


Line 383:                     dstVol.extend((volParams['apparentsize'] + 511) / 512)
Line 384: 
Line 385:                     # Change destination volume metadata back to the original
Line 386:                     # type.
Line 387:                     if tmpVolPreallocation != volParams['prealloc']:
You also have to handle this or we'll end up setting SPARSE_VOL on domains that doesn't support sparseness.

We should probably also enforce this check in setType.
Line 388:                         dstVol.setType(volParams['prealloc'])
Line 389: 
Line 390:                     dstChain.append(dstVol)
Line 391:                 except se.StorageException:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id95d700cf6acb46464d6c5d063966f9331a15028
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list