'btrfs qgroup show' used to output bytes in raw, but in
btrfs-progs v3.18.2 it outputs bytes with suffix KiB, MiB
or like by default, which causes error when parsing the output.
Fix it by adding '--raw' to let 'btrfs qgroup show' output raw numbers
always.
Signed-off-by: Hu Tao <hutao(a)cn.fujitsu.com>
---
daemon/btrfs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 5cab52a..402b7de 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -1231,6 +1231,7 @@ do_btrfs_qgroup_show (const char *path)
ADD_ARG (argv, i, str_btrfs);
ADD_ARG (argv, i, "qgroup");
ADD_ARG (argv, i, "show");
+ ADD_ARG (argv, i, "--raw");
ADD_ARG (argv, i, path_buf);
ADD_ARG (argv, i, NULL);
@@ -1240,6 +1241,9 @@ do_btrfs_qgroup_show (const char *path)
return NULL;
}
+ if (verbose)
+ fprintf (stderr, "output of 'btrfs qgroup show %s' is:\n%s\n",
path_buf, out);
+
lines = split_lines (out);
if (!lines)
return NULL;
--
2.1.0