Change in vdsm[master]: fileVolume: remove unneeded size conversion in _create

Federico Simoncelli fsimonce at redhat.com
Tue May 13 10:54:22 UTC 2014


Federico Simoncelli has uploaded a new change for review.

Change subject: fileVolume: remove unneeded size conversion in _create
......................................................................

fileVolume: remove unneeded size conversion in _create

It quite some time that blockVolume._create is already treating the
size argument as an integer (e.g. in the SECTORS_TO_MB computation).
The two places where size is set are: createVolume (hsm.py) where
validateN does the integer conversion and volume.getSize where
there's and explicit call to int.

Change-Id: I3d27f9bf3d5cbab593103ae0510bdb1c7b5dd240
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
---
M vdsm/storage/fileVolume.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/27620/1

diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index f2a93d6..2d6d43d 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -118,7 +118,7 @@
         properly handled and logged in volume.create()
         """
 
-        sizeBytes = int(size) * BLOCK_SIZE
+        sizeBytes = size * BLOCK_SIZE
 
         try:
             oop.getProcessPool(dom.sdUUID).truncateFile(volPath, sizeBytes,


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d27f9bf3d5cbab593103ae0510bdb1c7b5dd240
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>


More information about the vdsm-patches mailing list