[Libguestfs] [PATCH 3/3] resize: copy GPT partition flags

Pino Toscano ptoscano at redhat.com
Fri Jan 12 15:38:28 UTC 2018


On Wednesday, 10 January 2018 13:07:51 CET Cédric Bosdonnat wrote:
> In some cases, the first stage bootloader needs the 'Legacy BIOS
> bootable' flag to be set on the partition. This change copies all
> flags (including this one) for each partition of the old disk to the
> new one to avoid ending up with non-bootable disks.
> ---

This of course needs changes according to my notes in patch #2
(basically regarding the type for the part_(get|set)_gpt_attributes
APIs).

> @@ -1191,12 +1199,13 @@ read the man page virt-resize(1).
>     * is changed from primary to extended.  Thus we need to set the
>     * MBR ID before doing the copy so sfdisk doesn't corrupt things.
>     *)
> -  let set_partition_bootable_and_id p =
> +  let set_partition_bootable_attributes_and_id p =

Considering the function already does more than what the name says,
I would simply rename it to set_partition_attributes, and be done with
it.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20180112/86f95cb3/attachment.sig>


More information about the Libguestfs mailing list