diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-02-27 14:05:38 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-02-27 17:26:09 +0000 |
commit | d1711dae9dbd7f516469f88807604894c1304228 (patch) | |
tree | 7a9fcf153c46f829ace01e7f12ff1a82d7171772 /daemon/ext2.c | |
parent | e567f064e235f23ef709d4ed52834fb2135c6956 (diff) | |
download | libguestfs-d1711dae9dbd7f516469f88807604894c1304228.tar.gz libguestfs-d1711dae9dbd7f516469f88807604894c1304228.tar.xz libguestfs-d1711dae9dbd7f516469f88807604894c1304228.zip |
New API: set-label, for setting a label on any filesystem.
Currently only ext2/3/4 and (newly) NTFS are supported.
This change also deprecates set-e2label.
Diffstat (limited to 'daemon/ext2.c')
-rw-r--r-- | daemon/ext2.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/daemon/ext2.c b/daemon/ext2.c index a6439352..02cd68aa 100644 --- a/daemon/ext2.c +++ b/daemon/ext2.c @@ -29,9 +29,6 @@ #include "c-ctype.h" #include "actions.h" -/* Confirmed this is true up to ext4 from the Linux sources. */ -#define EXT2_LABEL_MAX 16 - #define MAX_ARGS 64 /* Choose which tools like mke2fs to use. For RHEL 5 (only) there @@ -154,28 +151,7 @@ do_tune2fs_l (const char *device) int do_set_e2label (const char *device, const char *label) { - int r; - char *err; - - char prog[] = "e2label"; - if (e2prog (prog) == -1) - return -1; - - if (strlen (label) > EXT2_LABEL_MAX) { - reply_with_error ("%s: ext2 labels are limited to %d bytes", - label, EXT2_LABEL_MAX); - return -1; - } - - r = command (NULL, &err, prog, device, label, NULL); - if (r == -1) { - reply_with_error ("%s", err); - free (err); - return -1; - } - - free (err); - return 0; + return do_set_label (device, label); } char * |