[Libguestfs] [PATCH v3 2/7] resize: simplify the code to filter parts

Hu Tao hutao at cn.fujitsu.com
Mon Sep 22 07:47:35 UTC 2014


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

diff --git a/resize/resize.ml b/resize/resize.ml
index 72c4da2..8f2105c 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -454,13 +454,8 @@ read the man page virt-resize(1).
 
     (* Filter out logical partitions.  See note above. *)
     let parts =
-      match parttype with
-      | GPT -> parts
-      | MBR ->
-        List.filter (function
-        | { G.part_num = part_num } when part_num >= 5_l -> false
-        | _ -> true
-        ) parts in
+        List.filter (fun p -> parttype <> MBR || p.G.part_num <= 4_l)
+        parts in
 
     let partitions =
       List.map (
-- 
1.9.3




More information about the Libguestfs mailing list