Dan Kenigsberg has posted comments on this change.

Change subject: RAM snapshots feature
......................................................................


Patch Set 17: I would prefer that you didn't submit this

(2 inline comments)

....................................................
File vdsm/storage/fileUtils.py
Line 401:         os.chmod(path, (mode & 0707) | newGroupMode)
Line 402: 
Line 403: 
Line 404: def padToBlockSize(path):
Line 405:     fd = os.open(path, os.O_WRONLY)
It would be a bit nicer to work with Python file object, and only pass the 
f.fileno() to functions that need it.
Line 406:     size = os.fstat(fd).st_size
Line 407:     os.ftruncate(fd, 512 * ceil(size / 512.0))


Line 403: 
Line 404: def padToBlockSize(path):
Line 405:     fd = os.open(path, os.O_WRONLY)
Line 406:     size = os.fstat(fd).st_size
Line 407:     os.ftruncate(fd, 512 * ceil(size / 512.0))
no need for math.ceil for

  (size + 511) / 512

The math module should be kept for scientific approximation, not file size 
handling.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I62401940afb0228cbd9dd3611b6ed8e0ff67c82c
Gerrit-PatchSet: 17
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Eduardo <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Peter V. Saveliev <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to