[Libguestfs] [PATCH v2 10/13] resize: add function set_partition_bootable_and_id

Hu Tao hutao at cn.fujitsu.com
Fri Sep 19 07:39:12 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 3db9291..64697f9 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -1151,8 +1151,7 @@ read the man page virt-resize(1).
    * so that we can magically change the primary partition to an extended
    * partition if necessary.
    *)
-  List.iter (
-    fun p ->
+  let set_partition_bootable_and_id p =
       if p.p_bootable then
         g#part_set_bootable "/dev/sdb" p.p_target_partnum true;
 
@@ -1168,7 +1167,8 @@ read the man page virt-resize(1).
       | MBR, MBR_ID mbr_id ->
         g#part_set_mbr_id "/dev/sdb" p.p_target_partnum mbr_id
       | GPT, (No_ID|MBR_ID _) | MBR, (No_ID|GPT_Type _) -> ()
-  ) partitions;
+  in
+  List.iter set_partition_bootable_and_id partitions;
 
   (* Fix the bootloader if we aligned the first partition. *)
   if align_first_partition_and_fix_bootloader then (
-- 
1.9.3




More information about the Libguestfs mailing list