Dan Kenigsberg has posted comments on this change.

Change subject: Making getVSize and getVTrueSize SD methods.
......................................................................


Patch Set 6: Code-Review-1

(4 comments)

....................................................
File tests/volumeTests.py
Line 59:     def tearDown(self):
Line 60:         shutil.rmtree(self.mountpoint)
Line 61: 
Line 62:     def test(self):
Line 63:         volSize = int(self.sdobj.getVSize(self.imgUUID, self.volUUID) 
/ 512)
shouldn't you use seld.SDBLKSZ instead of 512?


....................................................
File vdsm/storage/blockSD.py
Line 132:     return LVM_ENC_ESCAPE.sub(lambda c: unichr(int(c.groups()[0])), s)
Line 133: 
Line 134: 
Line 135: def _get_st_size(devPath):
Line 136:     """ Size in bytes of a dm device workaround.
Ayal's questions are left unanswered. I assume he did not understand/liked the 
English of the docstring.

I find the original name (tellEnd) clearer, as it simply tell()s the position 
of SEEK_END. Current name is misleading (it does not use st_size!).
Line 137: 
Line 138:     stat.st_size (in /sys/block/dm-*/stat) is identically 0.
Line 139:     """
Line 140:     with open(devPath, "rb") as f:


Line 137: 
Line 138:     stat.st_size (in /sys/block/dm-*/stat) is identically 0.
Line 139:     """
Line 140:     with open(devPath, "rb") as f:
Line 141:         f.seek(0, 2)
please keep the readable constant name os.SEEK_END.
Line 142:         return f.tell()
Line 143: 
Line 144: 
Line 145: def _getVolsTree(sdUUID):


....................................................
File vdsm/storage/fileSD.py
Line 287:         return self.oop.fileUtils.pathExists(volPath)
Line 288: 
Line 289:     def getVSize(self, imgUUID, volUUID):
Line 290:         """ Returns file volume size in bytes. """
Line 291:         volPath = os.path.join(self.mountpoint, self.sdUUID, 'images',
yeela's comment unanswered. Not that I'm a big fan of getVolPath, or think that 
it should be introduced here.
Line 292:                                imgUUID, volUUID)
Line 293:         return self.oop.os.stat(volPath).st_size
Line 294: 
Line 295:     def getVAllocSize(self, imgUUID, volUUID):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3d9772cedd74431e71d6068399546e1b4aae69e9
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewars...@redhat.com>
Gerrit-Reviewer: Ayal Baron <aba...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Eduardo <ewars...@redhat.com>
Gerrit-Reviewer: Elad Ben Aharon <eladba1...@gmail.com>
Gerrit-Reviewer: Yeela Kaplan <ykap...@redhat.com>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to