| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
If you ran part-get-parttype command on a device which didn't
contain a partition, it used to return the string "loop". This
is an internal representation that parted uses. We should instead
return an error because part-get-parttype makes no sense for
devices which are not partitioned.
|
|
|
|
|
|
| |
Change the part-disk command so it aligns the partition to
64 sectors (instead of 1 or 34 sectors as now). This should
ensure that the filesystem contained within is aligned.
|
| |
|
|
|
|
|
|
|
|
| |
This fixes the following commands when run with RHEL 5-era parted:
get-bootable
get-parttype
part-list
|
| |
|
|
|
|
| |
These APIs flesh out further the partitioning API.
|
|
|
|
|
|
|
|
| |
Previously we used strtok. However this has the problem that
strtok considers multiple delimiter characters to be like a single
delimiter, eg. "1:::2" would be parsed the same as "1:2". In
other words, the previous code would skip over or fail if there
are empty fields.
|
|
|
|
|
| |
This allows us to make the RUN_PARTED macro do something else
along the error path, other than just returning -1.
|
|
|
|
|
|
| |
Change the appliance so PATH includes common directories. Thus
we don't need to hard-code paths to binaries (eg. "/sbin/fdisk")
everywhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The RPC stubs already prefix the command name to error messages.
The daemon doesn't have to do this. As a (small) benefit this also
makes the daemon slightly smaller.
Code in the daemon such as:
if (argv[0] == NULL) {
reply_with_error ("passed an empty list");
return NULL;
}
now results in error messages like this:
><fs> command ""
libguestfs: error: command: passed an empty list
(whereas previously you would have seen ..command: command:..)
|
| |
|
|
This commit introduces a generic partition creation interface
which should be future-proof and extensible, and partially
replaces the old sfdisk-based interface.
The implementation is based on parted but is hopefully not too
dependent on the particulars of parted.
The following new calls are introduced:
guestfs_part_init:
Initialize a disk with a partition table. Unlike the sfdisk-
based interface, we also support GPT and other partition
types, which is essential to scale to devices larger than 2TB.
guestfs_part_add: Add a partition to an existing disk.
guestfs_part_disk:
Convenience function which combines part_init & part_add,
creating a single partition that covers the whole disk.
guestfs_part_set_bootable:
guestfs_part_set_name:
Set various aspects of existing partitions.
guestfs_part_list:
List partitions on a device. This returns a programming-friendly
list of partition structs (in contrast to sfdisk-l which cannot
be parsed).
guestfs_part_get_parttype:
Return the partition table type, eg. "msdos" or "gpt".
The following calls are planned, but not added currently:
guestfs_part_get_bootable
guestfs_part_get_name
guestfs_part_set_type
guestfs_part_get_type
|