summaryrefslogtreecommitdiffstats
path: root/daemon/parted.c
Commit message (Collapse)AuthorAgeFilesLines
* part-get-bootable: Fix when partitions are missing or unordered (RHBZ#602997).Richard W.M. Jones2011-07-121-4/+30
|
* Coverity: Don't leak error strings.Richard W.M. Jones2011-06-091-3/+6
|
* daemon: Remove some less useful debugging messages.Richard W.M. Jones2011-05-081-7/+1
| | | | | | | | Remove some debug messages which were basically left over from when the code was being developed. However we leave debug messages where it is printing an external command that is about to be executed, since those are useful.
* parted: Don't return "loop" for non-partitioned devices (RHBZ#634246).Richard W.M. Jones2010-10-181-0/+15
| | | | | | | | 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.
* part-disk: Align whole disk partition to 64 sectors.Richard W.M. Jones2010-10-061-15/+9
| | | | | | 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.
* parted: Check partition number >= 1 in several calls.Richard Jones2010-06-021-0/+30
|
* daemon: Parse output of old parted which didn't support -m option (RHBZ#598309).Richard Jones2010-06-021-83/+284
| | | | | | | | This fixes the following commands when run with RHEL 5-era parted: get-bootable get-parttype part-list
* daemon: count_strings function returns size_tRichard Jones2010-06-021-1/+1
|
* New partition APIs: part_del, part_get_bootable, part_get/set_mbr_idRichard Jones2010-04-101-0/+101
| | | | These APIs flesh out further the partitioning API.
* daemon: More reliable parsing of the output from 'parted print'.Richard Jones2010-04-101-19/+33
| | | | | | | | 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.
* daemon: Make the RUN_PARTED macro take an error statement.Richard Jones2010-04-101-7/+9
| | | | | This allows us to make the RUN_PARTED macro do something else along the error path, other than just returning -1.
* appliance: Set $PATH instead of hard-coding paths to binaries everywhere.Richard Jones2010-03-261-3/+3
| | | | | | Change the appliance so PATH includes common directories. Thus we don't need to hard-code paths to binaries (eg. "/sbin/fdisk") everywhere.
* daemon: Don't need to prefix error messages with the command name.Richard Jones2010-02-121-8/+8
| | | | | | | | | | | | | | | | | | | | 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:..)
* Fix problems found by 'make syntax check'Richard Jones2009-11-101-43/+43
|
* Generic partition creation interface.Richard Jones2009-11-101-0/+357
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