[Libguestfs] [PATCH] New API: part_get_disk_guid and part_set_disk_guid.

Richard W.M. Jones rjones at redhat.com
Mon Jan 18 16:47:30 UTC 2016


On Mon, Jan 18, 2016 at 07:29:58PM +0300, Maxim Perevedentsev wrote:
> +int
> +do_part_set_disk_guid (const char *device, const char *guid)
> +{
> +  CLEANUP_FREE char *err = NULL;
> +  int r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
> +                    str_sgdisk, device, "-U", guid, NULL);

The sgdisk command accepts 'R' to mean use a random GUID.  I believe
that because you declare the parameter in the generator as `GUID "guid"'
that we will reject 'R' (which is a good thing).

It'd perhaps be nice to add another API for setting the GUID to a
random value (it could be called `guestfs_part_set_disk_guid_random').

The rest of the patch looks fine to me, and is ready to go upstream as
far as I'm concerned.  Pino -- any comment?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list