[Pkg-libvirt-commits] [libguestfs] 06/66: resize: convert sectsize to int64

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:47:35 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.54-1
in repository libguestfs.

commit b05b9ba8bfb6db4fbb0f7325e8ff326978c46d1e
Author: Hu Tao <hutao at cn.fujitsu.com>
Date:   Fri Sep 19 15:39:03 2014 +0800

    resize: convert sectsize to int64
    
    Because sectsize is used as int64 everywhere.
    
    Signed-off-by: Hu Tao <hutao at cn.fujitsu.com>
---
 resize/resize.ml | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/resize/resize.ml b/resize/resize.ml
index 0485db0..e1634de 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -367,7 +367,7 @@ read the man page virt-resize(1).
    * way to do it is with g#blockdev_getsize64.
    *)
   let sectsize, insize, outsize =
-    let sectsize = g#blockdev_getss "/dev/sdb" in
+    let sectsize = Int64.of_int (g#blockdev_getss "/dev/sdb") in
     let insize = g#blockdev_getsize64 "/dev/sda" in
     let outsize = g#blockdev_getsize64 "/dev/sdb" in
     if verbose then (
@@ -722,7 +722,7 @@ read the man page virt-resize(1).
       let first_part_start_sects =
         match partitions with
         | { p_part = { G.part_start = start }} :: _ ->
-          start /^ Int64.of_int sectsize
+          start /^ sectsize
         | [] -> 0L in
 
       let max_bootloader_sects = Int64.of_int max_bootloader /^ 512L in
@@ -737,7 +737,7 @@ read the man page virt-resize(1).
       (* Add up the total max. overhead. *)
       let overhead_sects =
         start_overhead_sects +^ alignment_sects +^ gpt_end_sects in
-      Int64.of_int sectsize *^ overhead_sects in
+      sectsize *^ overhead_sects in
 
     let required = List.fold_left (
       fun total p ->
@@ -1019,8 +1019,6 @@ read the man page virt-resize(1).
    * on the target.
    *)
   let partitions =
-    let sectsize = Int64.of_int sectsize in
-
     let rec loop partnum start = function
       | p :: ps ->
         (match p.p_operation with

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list