search for: test_btrftune_uuid_opt

Displaying 7 results from an estimated 7 matches for "test_btrftune_uuid_opt".

2015 Jun 24
2
Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...change fsid to UUID > + * -u change fsid, use a random one > + * since v4.1 > + * We could check wheter 'btrfstune' support > + * '-u' and '-U UUID' option by checking the output of > + * 'btrfstune' command. > + */ > +static int > +test_btrftune_uuid_opt (void) > +{ > + static int result = -1; > + if (result != -1) > + return result; > + > + CLEANUP_FREE char *err = NULL; > + > + int r = commandr (NULL, &err, str_btrfstune, NULL); > + > + if (r == -1) { > + reply_with_error ("btrfstune: %s",...
2015 Jun 25
0
Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...change fsid, use a random one > > + * since v4.1 > > + * We could check wheter 'btrfstune' support > > + * '-u' and '-U UUID' option by checking the output of > > + * 'btrfstune' command. > > + */ > > +static int > > +test_btrftune_uuid_opt (void) > > +{ > > + static int result = -1; > > + if (result != -1) > > + return result; > > + > > + CLEANUP_FREE char *err = NULL; > > + > > + int r = commandr (NULL, &err, str_btrfstune, NULL); > > + > > + if (r == -1) { >...
2015 Jun 24
10
[PATCH 0/5] uuid: add btrfs uuid change support and some rework
- Btrfs-progs v4.1 introduced new feature of changing uuid of btrfs partition. This patch add support of this. - uuids.c did a lot of deplicated work for changing uuid of fs. Use existed functions. -- Introduce new API: btrfstune_set_uuid_random Chen Hanxiao (5): uuid: add support to change uuid of btrfs partition uuid: use existed function of ext2 uuid: use newly introduced
2015 Jun 24
0
[PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...and add two new options + * -U UUID change fsid to UUID + * -u change fsid, use a random one + * since v4.1 + * We could check wheter 'btrfstune' support + * '-u' and '-U UUID' option by checking the output of + * 'btrfstune' command. + */ +static int +test_btrftune_uuid_opt (void) +{ + static int result = -1; + if (result != -1) + return result; + + CLEANUP_FREE char *err = NULL; + + int r = commandr (NULL, &err, str_btrfstune, NULL); + + if (r == -1) { + reply_with_error ("btrfstune: %s", err); + return -1; + } + + /* FIXME currently btr...
2015 Jun 26
0
[PATCH v3 1/4] uuid: add support to change uuid of btrfs partition
...and add two new options + * -U UUID change fsid to UUID + * -u change fsid, use a random one + * since v4.1 + * We could check wheter 'btrfstune' support + * '-u' and '-U UUID' option by checking the output of + * 'btrfstune' command. + */ +static int +test_btrftune_uuid_opt (void) +{ + static int result = -1; + if (result != -1) + return result; + + CLEANUP_FREE char *err = NULL; + + int r = commandr (NULL, &err, str_btrfstune, NULL); + + if (r == -1) { + reply_with_error ("btrfstune: %s", err); + return -1; + } + + /* FIXME currently btr...
2015 Jun 24
0
[PATCH 5/5] New API: btrfstune_set_uuid_random
...fs.c index b82c1b9..e4d8b64 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -867,6 +867,27 @@ btrfstune_set_uuid (const char *device, const char *uuid) return 0; } +int +do_btrfstune_set_uuid_random (const char *device) +{ + CLEANUP_FREE char *err = NULL; + int r; + int has_uuid_opts = test_btrftune_uuid_opt(); + + if (has_uuid_opts == 0) { + reply_with_error ("btrfstune do not support '-u'"); + return -1; + } + + r = commandr (NULL, &err, str_btrfstune, "-u", device, NULL); + if (r == -1) { + reply_with_error("%s: %s", device, err); + return -1...
2015 Jun 26
5
[PATCH v3 0/4] uuid: add btrfs uuid change support and some rework
- Btrfs-progs v4.1 introduced new feature of changing uuid of btrfs partition. This patch add support of this. - uuids.c did a lot of deplicated work for changing uuid of fs. Use existing functions. v3: set errno if feature is not available. Chen Hanxiao (4): uuid: add support to change uuid of btrfs partition uuid: use existing function of ext2 uuid: use newly introduced