[Libguestfs] [PATCH v2 09/13] resize: add function copy_partition

Hu Tao hutao at cn.fujitsu.com
Fri Sep 19 07:39:11 UTC 2014


Signed-off-by: Hu Tao <hutao at cn.fujitsu.com>
---
 resize/resize.ml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/resize/resize.ml b/resize/resize.ml
index f57b2ff..3db9291 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -1110,8 +1110,7 @@ read the man page virt-resize(1).
   ) partitions;
 
   (* Copy over the data. *)
-  List.iter (
-    fun p ->
+  let copy_partition p =
       match p.p_operation with
       | OpCopy | OpResize _ ->
         (* XXX Old code had 'when target_partnum > 0', but it appears
@@ -1145,7 +1144,8 @@ read the man page virt-resize(1).
            g#copy_device_to_device ~srcoffset ~size:copysize "/dev/sda" target
         )
       | OpIgnore | OpDelete -> ()
-  ) partitions;
+  in
+  List.iter copy_partition partitions;
 
   (* Set bootable and MBR IDs.  Do this *after* copying over the data,
    * so that we can magically change the primary partition to an extended
-- 
1.9.3




More information about the Libguestfs mailing list