** NOT TO BE PUSHED ** This doesn't quite work at the moment. All the
tests pass, except: test_list_partitions_0 wipes the disk and creates
a single partition covering the whole disk. However the test fails
because it thinks the disk has 3 partitions. At the moment I have no
idea why it would think this.
Anyway, the patch has evolved further:
(1) guestfs_set_part_name can be used to set the name of a partition.
(2) In guestfs_part_disk, if GPT set the partition name to "p1". But
in guestfs_part_add we still have the bug that the partition name is
set to "primary" for GPT partition tables. At least this is now
documented as a bug.
(3) Work around an apparent bug in parted where it fails to do
ioctl(BLKRRPART) [re-read the partition table], by catching this case
and rereading the partition table ourselves.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages.
http://et.redhat.com/~rjones/libguestfs/
See what it can do:
http://et.redhat.com/~rjones/libguestfs/recipes.html