btrfs-progs: btrfstune: add '-U' and '-u' option to change fsid
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 15 May 2015 06:28:25 +0000 (14:28 +0800)
committerDavid Sterba <dsterba@suse.cz>
Tue, 26 May 2015 15:21:47 +0000 (17:21 +0200)
commit5fd37009daec2447c0a27664995f356768e1a204
tree5ff9df12533354c7057d0982c0c56628af401773
parent0522713f3c0a2251e7e52e747f2008ed78dba7f9
btrfs-progs: btrfstune: add '-U' and '-u' option to change fsid

Add two options, '-U' and '-u' for btrfstune.

For '-u', it is used to change fsid to a random new UUID.
For '-U', it is used to change fsid to a specified UUID.

Both will also change the internal use only chunk_tree_uuid to a random
new UUID.

Although there is a GNU getopt extension "::" to get optional
option-argument, but is forbidden by POSIX.1-2008, so use split options
here.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfstune.c