[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH v2 09/11] resize: more misc ops on logical partition



Signed-off-by: Chen Hanxiao <chenhanxiao cn fujitsu com>
---
 resize/resize.ml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/resize/resize.ml b/resize/resize.ml
index db7e0b3..37b946e 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -1274,6 +1274,7 @@ read the man page virt-resize(1).
       | GPT, (No_ID|MBR_ID _) | MBR, (No_ID|GPT_Type _) -> ()
   in
   List.iter set_partition_bootable_and_id partitions;
+  List.iter set_partition_bootable_and_id logical_partitions;
 
   (* Fix the bootloader if we aligned the first partition. *)
   if align_first_partition_and_fix_bootloader then (
@@ -1325,6 +1326,13 @@ read the man page virt-resize(1).
         can_expand_content p.p_type
       | { p_operation = (OpCopy | OpIgnore | OpDelete) } -> false
     ) partitions
+    ||
+    List.exists (
+      function
+      | ({ p_operation = OpResize _ } as p) ->
+        can_expand_content p.p_type
+      | { p_operation = (OpCopy | OpIgnore | OpDelete) } -> false
+    ) logical_partitions
     || List.exists (
       function
       | ({ lv_operation = LVOpExpand } as lv) ->
@@ -1386,6 +1394,7 @@ read the man page virt-resize(1).
         -> ()
     in
     List.iter expand_partition_content partitions;
+    List.iter expand_partition_content logical_partitions;
 
     (* Expand logical volume content as required. *)
     List.iter (
-- 
2.1.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]