Federico Simoncelli has posted comments on this change.

Change subject: Remove redundant check that causes lvm cache to refresh every 
volume creation
......................................................................


Patch Set 1:

(1 comment)

....................................................
File vdsm/storage/volume.py
Line 401:         """
Line 402:         cls.validateCreateVolumeParams(volFormat, preallocate, 
srcVolUUID)
Line 403: 
Line 404:         dom = sdCache.produce(sdUUID)
Line 405:         imgPath = image.Image(repoPath).create(sdUUID, imgUUID)
That is enough only for sparse volumes:

 if preallocate == volume.SPARSE_VOL:
     # Sparse = regular file
     oop.getProcessPool(dom.sdUUID).truncateFile(volPath, sizeBytes)
 else:
     try:
         # ddWatchCopy expects size to be in bytes
         misc.ddWatchCopy("/dev/zero", volPath, vars.task.aborting, sizeBytes)
 ...

Anyway I'm sure we can do something like:

 oop.getProcessPool(dom.sdUUID).truncateFile(volPath, sizeBytes, ...)

 if preallocate == volume.PREALLOCATED_VOL:
     try:
          # ddWatchCopy expects size to be in bytes
         misc.ddWatchCopy("/dev/zero", volPath, vars.task.aborting, sizeBytes)
 ...

About truncateFile, I'm not sure if we want to expose the posix flags, maybe we 
could just add an creatExcl bool:

 def truncateFile(path, size, mode=None, creatExcl=False):
     ...

Anyway either way is ok with me.
Line 406: 
Line 407:         volPath = os.path.join(imgPath, volUUID)
Line 408:         volParent = None
Line 409:         volType = type2name(LEAF_VOL)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib6f3b6ca8313070d0345b5f76ebb0b3d9772d14f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to