[Libguestfs] [PATCH 09/10] resize: support resize extended partition

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Thu Apr 23 06:14:21 UTC 2015


Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 resize/resize.ml | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/resize/resize.ml b/resize/resize.ml
index 67321c2..146c170 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -1245,20 +1245,7 @@ read the man page virt-resize(1).
          | ContentUnknown | ContentPV _ | ContentFS _ ->
            g#copy_device_to_device ~size:copysize ~sparse source target
 
-         | ContentExtendedPartition ->
-           (* You can't just copy an extended partition by name, eg.
-            * source = "/dev/sda2", because the device name only covers
-            * the first 1K of the partition.  Instead, copy the
-            * source bytes from the parent disk (/dev/sda).
-            *
-            * You can't write directly to the extended partition,
-            * because the size of it reported by Linux is always 1024
-            * bytes. Instead, write to the offset of the extended
-            * partition in the destination disk (/dev/sdb).
-            *)
-           let srcoffset = p.p_part.G.part_start in
-           let destoffset = p.p_target_start *^ 512L in
-           g#copy_device_to_device ~srcoffset ~destoffset ~size:copysize "/dev/sda" "/dev/sdb"
+         | ContentExtendedPartition -> ()
         )
       | OpIgnore | OpDelete -> ()
   in
-- 
2.1.0




More information about the Libguestfs mailing list