search for: do_btrfs_qgroup_show

Displaying 20 results from an estimated 34 matches for "do_btrfs_qgroup_show".

2015 Jun 17
1
Re: [PATCH v4 1/3] do_btrfs_qgroup_show: fix a bad return value
...> > daemon/btrfs.c | 40 ++++++++++++++++++---------------------- > 1 file changed, 18 insertions(+), 22 deletions(-) > > diff --git a/daemon/btrfs.c b/daemon/btrfs.c > index 7b14bac..8d03caa 100644 > --- a/daemon/btrfs.c > +++ b/daemon/btrfs.c > @@ -1249,7 +1249,7 @@ do_btrfs_qgroup_show (const char *path) > CLEANUP_FREE char *err = NULL; > CLEANUP_FREE char *out = NULL; > int r; > - char **lines; > + CLEANUP_FREE_STRING_LIST char **lines = NULL; > > path_buf = sysroot_path (path); > if (path_buf == NULL) { > @@ -1275,17 +1275,19 @@ do_...
2015 Jun 17
0
[PATCH v4 1/3] do_btrfs_qgroup_show: fix a bad return value
...#39;s '%m'. v3: fix test case failure daemon/btrfs.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 7b14bac..8d03caa 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1249,7 +1249,7 @@ do_btrfs_qgroup_show (const char *path) CLEANUP_FREE char *err = NULL; CLEANUP_FREE char *out = NULL; int r; - char **lines; + CLEANUP_FREE_STRING_LIST char **lines = NULL; path_buf = sysroot_path (path); if (path_buf == NULL) { @@ -1275,17 +1275,19 @@ do_btrfs_qgroup_show (const char *path) if (!...
2015 Jun 18
2
[PATCH v5 1/2] do_btrfs_qgroup_show: fix a bad return value
...scanf's '%m'. v3: fix test case failure daemon/btrfs.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 2f875ae..715d7d2 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1249,7 +1249,7 @@ do_btrfs_qgroup_show (const char *path) CLEANUP_FREE char *err = NULL; CLEANUP_FREE char *out = NULL; int r; - char **lines; + CLEANUP_FREE_STRING_LIST char **lines = NULL; path_buf = sysroot_path (path); if (path_buf == NULL) { @@ -1275,17 +1275,19 @@ do_btrfs_qgroup_show (const char *path) if (!...
2015 Jun 15
0
[PATCH v3 1/3] do_btrfs_qgroup_show: fix a bad return value
...<chenhanxiao@cn.fujitsu.com> --- v3: don't return internal tmp values. daemon/btrfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 39392f7..5011ec4 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1254,7 +1254,7 @@ do_btrfs_qgroup_show (const char *path) CLEANUP_FREE char *err = NULL; CLEANUP_FREE char *out = NULL; int r; - char **lines; + CLEANUP_FREE_STRING_LIST char **lines = NULL; path_buf = sysroot_path (path); if (path_buf == NULL) { @@ -1320,14 +1320,14 @@ do_btrfs_qgroup_show (const char *path) g...
2015 Mar 16
2
[PATCH] btrfs-qgroup-show: add check for "--raw"
...s, "qgroup", "show", "--help", NULL); + + if (r == -1) { + reply_with_error ("btrfs qgroup show --help: %s", err); + return -1; + } + + if (!strstr (out, "--raw")) + result = 0; + + return result; +} + guestfs_int_btrfsqgroup_list * do_btrfs_qgroup_show (const char *path) { const size_t MAX_ARGS = 64; const char *argv[MAX_ARGS]; size_t i = 0; + int btrfs_qgroup_show_raw_opt = test_btrfs_qgroup_show_raw_opt (); CLEANUP_FREE char *path_buf = NULL; CLEANUP_FREE char *err = NULL; CLEANUP_FREE char *out = NULL; @@ -1231,6 +1262,8 @@...
2015 Jun 17
6
[PATCH v4 0/3] btrfs: use CLEANUP_FREE_STRING_LIST for list free
As Pino's comment, we should take advantage of macro CLEANUP_FREE_STRING_LIST v4: remove some redundant strdup v3: fix test case failure v2: properly initialize lines Chen Hanxiao (3): do_btrfs_qgroup_show: fix a bad return value do_btrfs_subvolume_list: fix a bad return value btrfs: use CLEANUP_FREE_STRING_LIST for list free daemon/btrfs.c | 70 +++++++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 33 deletions(-) -- 2.1.0
2015 Jun 15
7
[PATCH v3 0/3] btrfs: use CLEANUP_FREE_STRING_LIST for list free
As Pino's comment, we should take advantage of macro CLEANUP_FREE_STRING_LIST v3: fix test case failure v2: properly initialize lines Chen Hanxiao (3): do_btrfs_qgroup_show: fix a bad return value do_btrfs_subvolume_list: fix a bad return value btrfs: use CLEANUP_FREE_STRING_LIST for list free daemon/btrfs.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- 2.1.0
2015 Jun 12
1
[PATCH v2] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...mountable_t *fs) this->btrfssubvolume_path = line; } - free (lines); pcre_free (re); return ret; error: - free_stringslen (lines, nr_subvolumes); if (ret) free (ret->guestfs_int_btrfssubvolume_list_val); free (ret); if (re) pcre_free (re); @@ -1253,8 +1251,8 @@ do_btrfs_qgroup_show (const char *path) CLEANUP_FREE char *path_buf = NULL; CLEANUP_FREE char *err = NULL; CLEANUP_FREE char *out = NULL; + CLEANUP_FREE_STRING_LIST char **lines = NULL; int r; - char **lines; path_buf = sysroot_path (path); if (path_buf == NULL) { @@ -1323,11 +1321,9 @@ do_btrfs_q...
2015 Feb 04
1
[PATCH] btrfs: fix parsing of output of 'btrfs qgroup show' (RHBZ#1188553)
...s qgroup show' output raw numbers always. Signed-off-by: Hu Tao <hutao@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)...
2015 Jun 12
1
[PATCH] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...mountable_t *fs) this->btrfssubvolume_path = line; } - free (lines); pcre_free (re); return ret; error: - free_stringslen (lines, nr_subvolumes); if (ret) free (ret->guestfs_int_btrfssubvolume_list_val); free (ret); if (re) pcre_free (re); @@ -1254,7 +1252,7 @@ do_btrfs_qgroup_show (const char *path) CLEANUP_FREE char *err = NULL; CLEANUP_FREE char *out = NULL; int r; - char **lines; + CLEANUP_FREE_STRING_LIST char **lines; path_buf = sysroot_path (path); if (path_buf == NULL) { @@ -1323,11 +1321,9 @@ do_btrfs_qgroup_show (const char *path) this->bt...
2015 Jun 17
2
[PATCH] btrfs: keep calloc and its error message match
...nt_btrfssubvolume_list_val = calloc (nr_subvolumes, sizeof (struct guestfs_int_btrfssubvolume)); if (ret->guestfs_int_btrfssubvolume_list_val == NULL) { - reply_with_perror ("malloc"); + reply_with_perror ("calloc"); goto error; } @@ -1292,7 +1292,7 @@ do_btrfs_qgroup_show (const char *path) ret->guestfs_int_btrfsqgroup_list_val = calloc (nr_qgroups, sizeof (struct guestfs_int_btrfsqgroup)); if (ret->guestfs_int_btrfsqgroup_list_val == NULL) { - reply_with_perror ("malloc"); + reply_with_perror ("calloc"); goto error;...
2015 Jun 23
1
[PATCH] btrfs: remove redundant whitespace
...@ -512,7 +512,7 @@ do_btrfs_subvolume_list (const mountable_t *fs) goto error; } - struct guestfs_int_btrfssubvolume *this = + struct guestfs_int_btrfssubvolume *this = &ret->guestfs_int_btrfssubvolume_list_val[i]; #if __WORDSIZE == 64 @@ -1298,7 +1298,7 @@ do_btrfs_qgroup_show (const char *path) for (i = 0; i < nr_qgroups; ++i) { char *line = lines[i + 2]; - struct guestfs_int_btrfsqgroup *this = + struct guestfs_int_btrfsqgroup *this = &ret->guestfs_int_btrfsqgroup_list_val[i]; uint64_t dummy1, dummy2; char *p; -- 2.1.0
2015 Mar 16
1
[PATCH v2] btrfs-qgroup-show: add check for "--raw"
...how", "--help", NULL); + + if (r == -1) { + reply_with_error ("btrfs qgroup show --help: %s", err); + return -1; + } + + if (strstr (out, "--raw") == NULL) + result = 0; + else + result = 1; + + return result; +} + guestfs_int_btrfsqgroup_list * do_btrfs_qgroup_show (const char *path) { const size_t MAX_ARGS = 64; const char *argv[MAX_ARGS]; size_t i = 0; + int has_raw_opt = test_btrfs_qgroup_show_raw_opt (); CLEANUP_FREE char *path_buf = NULL; CLEANUP_FREE char *err = NULL; CLEANUP_FREE char *out = NULL; @@ -1231,6 +1264,8 @@ do_btrfs_qgro...
2015 Mar 16
0
Re: [PATCH] btrfs-qgroup-show: add check for "--raw"
...t;, "--help", NULL); > + > + if (r == -1) { > + reply_with_error ("btrfs qgroup show --help: %s", err); > + return -1; > + } > + > + if (!strstr (out, "--raw")) !foo -> foo == NULL (clearer). > guestfs_int_btrfsqgroup_list * > do_btrfs_qgroup_show (const char *path) > { > const size_t MAX_ARGS = 64; > const char *argv[MAX_ARGS]; > size_t i = 0; > + int btrfs_qgroup_show_raw_opt = test_btrfs_qgroup_show_raw_opt (); Maybe a shorter name for the local variable will suffice? Something like has_raw_opt. > CLEANUP...
2015 Jun 17
0
Re: [PATCH] btrfs: keep calloc and its error message match
...alloc (nr_subvolumes, sizeof (struct guestfs_int_btrfssubvolume)); > if (ret->guestfs_int_btrfssubvolume_list_val == NULL) { > - reply_with_perror ("malloc"); > + reply_with_perror ("calloc"); > goto error; > } > > @@ -1292,7 +1292,7 @@ do_btrfs_qgroup_show (const char *path) > ret->guestfs_int_btrfsqgroup_list_val = > calloc (nr_qgroups, sizeof (struct guestfs_int_btrfsqgroup)); > if (ret->guestfs_int_btrfsqgroup_list_val == NULL) { > - reply_with_perror ("malloc"); > + reply_with_perror ("calloc&q...
2014 Dec 05
0
[PATCH 09/11] New API: btrfs_qgroup_show
...114 insertions(+), 1 deletion(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 15e481a..3d7e79c 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1184,3 +1184,91 @@ int do_btrfs_qgroup_destroy (const char *qgroupid, const char *subvolume) return 0; } + +guestfs_int_btrfsqgroup_list *do_btrfs_qgroup_show (const char *path) +{ + const size_t MAX_ARGS = 64; + const char *argv[MAX_ARGS]; + size_t i = 0; + CLEANUP_FREE char *path_buf = NULL; + CLEANUP_FREE char *err = NULL; + CLEANUP_FREE char *out = NULL; + int r; + char **lines; + + path_buf = sysroot_path (path); + if (path_buf == NULL) {...
2015 Jun 11
0
Re: [PATCH] New API: btrfs_filesystem_show_all
...> + return ret; > + > +error: > + free_stringslen (lines, nlines); As noted above, just make "lines" as CLEANUP_FREE_STRING_LIST. Also, it seems this wrong handling of the return value of split_lines has been done in other btrfs implementations: - do_btrfs_subvolume_list - do_btrfs_qgroup_show - do_btrfs_balance_status - do_btrfs_scrub_status > + if (label_tmp) > + free (label_tmp); > + if (uuid_tmp) > + free (uuid_tmp); > + > + for (i = 0; i < nr_filesystem_show; i++) { > + struct guestfs_int_btrfsfsshow *this_new = > + &ret->guestfs_i...
2015 Jun 11
2
[PATCH] New API: btrfs_filesystem_show_all
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> --- daemon/btrfs.c | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions.ml | 19 ++++++ generator/structs.ml | 13 ++++ src/MAX_PROC_NR | 2 +- 4 files changed, 209 insertions(+), 1 deletion(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 39392f7..09f7615 100644 --- a/daemon/btrfs.c +++
2015 Jun 11
1
Re: [PATCH] New API: btrfs_filesystem_show_all
...> > + free_stringslen (lines, nlines); > > As noted above, just make "lines" as CLEANUP_FREE_STRING_LIST. > > Also, it seems this wrong handling of the return value of split_lines > has been done in other btrfs implementations: > - do_btrfs_subvolume_list > - do_btrfs_qgroup_show > - do_btrfs_balance_status > - do_btrfs_scrub_status Yes, I'll send a patch to fix them later. > > > + if (label_tmp) > > + free (label_tmp); > > + if (uuid_tmp) > > + free (uuid_tmp); > > + > > + for (i = 0; i < nr_filesystem_show; i...
2017 Jun 19
0
[PATCH v7 13/13] daemon: Link guestfsd with libutils.
...ce_add (char *const *devices, const char *fs) int do_btrfs_device_delete (char *const *devices, const char *fs) { - const size_t nr_devices = count_strings (devices); + const size_t nr_devices = guestfs_int_count_strings (devices); if (nr_devices == 0) return 0; @@ -1391,7 +1391,7 @@ do_btrfs_qgroup_show (const char *path) * 0/5 9249849344 9249849344 * */ - const size_t nr_qgroups = count_strings (lines) - 2; + const size_t nr_qgroups = guestfs_int_count_strings (lines) - 2; guestfs_int_btrfsqgroup_list *ret = NULL; ret = malloc (sizeof *ret); if (!ret) { @@ -1821,7...