On Fri, Dec 05, 2014 at 12:30:52PM +0000, Richard W.M. Jones wrote:
On Tue, Dec 02, 2014 at 05:33:32PM +0800, Hu Tao wrote:
btrfs_subvolume_show shows the detailed information of a subvolume or snapshot.
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> --- daemon/btrfs.c | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions.ml | 9 +++ src/MAX_PROC_NR | 2 +- 3 files changed, 195 insertions(+), 1 deletion(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 471cfbd..2cfb364 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -24,11 +24,13 @@ #include <pcre.h> #include <string.h> #include <unistd.h> +#include <assert.h>
#include "daemon.h" #include "actions.h" #include "optgroups.h" #include "xstrtol.h" +#include "c-ctype.h"
GUESTFSD_EXT_CMD(str_btrfs, btrfs); GUESTFSD_EXT_CMD(str_btrfstune, btrfstune); @@ -810,3 +812,186 @@ do_btrfs_fsck (const char *device, int64_t superblock, int repair)
return 0; }
Ugh. 'btrfs' should have more easily parsable output.
+/* analyze_line: analyze one line contains key:value pair. + * returns the next position following \n. + */ +static char *analyze_line (char *line, char **key, char **value)
Can you put the function name on a new line, so:
Okay. Regards, Hu