It will should be count seperately later.

Signed-off-by: Chen Hanxiao <[email protected]>
---
 resize/resize.ml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/resize/resize.ml b/resize/resize.ml
index 42d39c9..9b4b49f 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -755,10 +755,12 @@ read the man page virt-resize(1).
     let required = List.fold_left (
       fun total p ->
         let newsize =
-          match p.p_operation with
-          | OpCopy | OpIgnore -> p.p_part.G.part_size
-          | OpDelete -> 0L
-          | OpResize newsize -> newsize in
+          (* size of extended partition and logical partition is calculated 
seperately *)
+          if p.p_type = ContentExtendedPartition || p.p_mbr_p_type = 
LogicalPartition then 0L else
+            match p.p_operation with
+            | OpCopy | OpIgnore -> p.p_part.G.part_size
+            | OpDelete -> 0L
+            | OpResize newsize -> newsize in
         total +^ newsize
     ) 0L partitions in
 
-- 
2.1.0

_______________________________________________
Libguestfs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to