diff options
author | Karel Zak | 2013-04-30 11:57:30 +0200 |
---|---|---|
committer | Karel Zak | 2013-09-16 16:46:53 +0200 |
commit | 3c5fb4757fa2ca0e4c30b9ec65ec87af2cc60bcb (patch) | |
tree | 1915a4de29b114721dfb11e4d27e7f4cd2017cf5 /libfdisk/src/label.c | |
parent | libfdisk: (gpt) use lib/tt.c to list partitions (diff) | |
download | kernel-qcow2-util-linux-3c5fb4757fa2ca0e4c30b9ec65ec87af2cc60bcb.tar.gz kernel-qcow2-util-linux-3c5fb4757fa2ca0e4c30b9ec65ec87af2cc60bcb.tar.xz kernel-qcow2-util-linux-3c5fb4757fa2ca0e4c30b9ec65ec87af2cc60bcb.zip |
libfdisk: add list() label operation
... and use it for GPT
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/label.c')
-rw-r--r-- | libfdisk/src/label.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libfdisk/src/label.c b/libfdisk/src/label.c index cc21f759e..d518d876d 100644 --- a/libfdisk/src/label.c +++ b/libfdisk/src/label.c @@ -99,6 +99,24 @@ int fdisk_verify_disklabel(struct fdisk_context *cxt) } /** + * fdisk_list_disklabel: + * @cxt: fdisk context + * + * Lists in-memory partition table + * + * Returns 0 on success, otherwise, a corresponding error. + */ +int fdisk_list_disklabel(struct fdisk_context *cxt) +{ + if (!cxt || !cxt->label) + return -EINVAL; + if (!cxt->label->op->list) + return -ENOSYS; + + return cxt->label->op->list(cxt); +} + +/** * fdisk_add_partition: * @cxt: fdisk context * @t: partition type to create or NULL for label-specific default |