Displaying 16 results from an estimated 16 matches for "btrfsqgroup_id".
2015 Jun 17
1
Re: [PATCH v4 1/3] do_btrfs_qgroup_show: fix a bad return value
...t; %" SCNu64 " %" SCNu64,
> - &dummy1, &dummy2, &this->btrfsqgroup_rfer,
> - &this->btrfsqgroup_excl) != 4) {
> + if (sscanf (line, "%m[0-9/] %" SCNu64 " %" SCNu64,
> + &this->btrfsqgroup_id, &this->btrfsqgroup_rfer,
> + &this->btrfsqgroup_excl) != 3) {
> reply_with_error ("cannot parse output of qgroup show command: %s", line);
> goto error;
> }
> - p = strchr(line, ' ');
> - if (!p) {
> -...
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(-)
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
2015 Jun 15
0
[PATCH v3 1/3] do_btrfs_qgroup_show: fix a bad return value
...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)
goto error;
}
*p = '\0';
- this->btrfsqgroup_id = line;
+ this->btrfsqgroup_id = strdup (line);
+ if (this->btrfsqgroup_id == NULL)
+ goto error;
}
- free (lines);
return ret;
error:
- free_stringslen (lines, nr_qgroups + 2);
if (ret)
free (ret->guestfs_int_btrfsqgroup_list_val);
free (ret);
--
2.1.0
2015 Jun 17
0
[PATCH v4 1/3] do_btrfs_qgroup_show: fix a bad return value
.../%" SCNu64 " %" SCNu64 " %" SCNu64,
- &dummy1, &dummy2, &this->btrfsqgroup_rfer,
- &this->btrfsqgroup_excl) != 4) {
+ if (sscanf (line, "%m[0-9/] %" SCNu64 " %" SCNu64,
+ &this->btrfsqgroup_id, &this->btrfsqgroup_rfer,
+ &this->btrfsqgroup_excl) != 3) {
reply_with_error ("cannot parse output of qgroup show command: %s", line);
goto error;
}
- p = strchr(line, ' ');
- if (!p) {
- reply_with_error ("truncated...
2015 Jun 18
2
[PATCH v5 1/2] do_btrfs_qgroup_show: fix a bad return value
.../%" SCNu64 " %" SCNu64 " %" SCNu64,
- &dummy1, &dummy2, &this->btrfsqgroup_rfer,
- &this->btrfsqgroup_excl) != 4) {
+ if (sscanf (line, "%m[0-9/] %" SCNu64 " %" SCNu64,
+ &this->btrfsqgroup_id, &this->btrfsqgroup_rfer,
+ &this->btrfsqgroup_excl) != 3) {
reply_with_error ("cannot parse output of qgroup show command: %s", line);
goto error;
}
- p = strchr(line, ' ');
- if (!p) {
- reply_with_error ("truncated...
2015 Jun 30
1
[PATCH] tests: fix two minor warnings
...4096 4096
+ $output = <<EOF;
+qgroupid rfer excl
+-------- ---- ----
+0/5 4096 4096
EOF
set_btrfs_output ($output);
- my @r = $g->btrfs_qgroup_show ("/");
+ @r = $g->btrfs_qgroup_show ("/");
die unless @r == 1;
die unless $r[0]->{btrfsqgroup_id} == "0/5";
die unless $r[0]->{btrfsqgroup_rfer} == 4096;
--
2.1.0
2014 Dec 05
0
[PATCH 09/11] New API: btrfs_qgroup_show
...&this->btrfsqgroup_excl) != 4) {
+ reply_with_perror ("sscanf");
+ goto error;
+ }
+ p = strchr(line, ' ');
+ if (!p) {
+ reply_with_error ("truncated line: %s", line);
+ goto error;
+ }
+ *p = '\0';
+ this->btrfsqgroup_id = line;
+ }
+
+ free (lines);
+ return ret;
+
+error:
+ free_stringslen (lines, nr_qgroups + 2);
+ if (ret)
+ free (ret->guestfs_int_btrfsqgroup_list_val);
+ free (ret);
+
+ return NULL;
+}
diff --git a/generator/actions.ml b/generator/actions.ml
index 78aafb7..c7df0dd 100644
--- a/gen...
2015 Jun 12
1
[PATCH] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...ow (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->btrfsqgroup_id = line;
}
- free (lines);
return ret;
error:
- free_stringslen (lines, nr_qgroups + 2);
if (ret)
free (ret->guestfs_int_btrfsqgroup_list_val);
free (ret);
@@ -1707,7 +1703,7 @@ do_btrfs_balance_status (const char *path)
char *out;
int r;
guestfs_int_btrfsbalance...
2015 Jun 12
1
[PATCH v2] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...th_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_qgroup_show (const char *path)
this->btrfsqgroup_id = line;
}
- free (lines);
return ret;
error:
- free_stringslen (lines, nr_qgroups + 2);
if (ret)
free (ret->guestfs_int_btrfsqgroup_list_val);
free (ret);
@@ -1704,10 +1700,10 @@ do_btrfs_balance_status (const char *path)
size_t i = 0;
CLEANUP_FREE char *path_buf =...
2014 Dec 02
21
[PATCH 0/8] btrfs support part2: qgroup commands
Hi,
This series adds support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
Hu Tao (8):
New API: btrfs_subvolume_get_default
New API: btrfs_subvolume_show
New API: btrfs_quota_enable
New API: btrfs_quota_disable
New API: btrfs_quota_rescan
New API: btrfs_qgroup_limit
New API: btrfs_qgroup_create
New API:
2014 Dec 12
15
[PATCH v3 00/11] btrfs support part2: qgroup/quota commands
Hi,
This is v3 series to add support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
changes:
v3:
- don't intialize fs_buf (patch 1)
- check the return value of sysroot_path (patch 1)
- check fs_buf rather than fs (patch 1)
- fprintf (stderr,...) -> reply_with_error()
v2:
- add tests for new APIs
- combine
2014 Dec 11
14
[PATCH v2 00/11] btrfs support part2: qgroup/quota commands
Hi,
This is v2 series to add support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
changes:
v2:
- add tests for new APIs
- combine btrfs_quota_enable and btrfs_quota_disable
- following APIs changed to operate on Mountable_or_Path:
btrfs_subvolume_get_default, btrfs_quota_enable, btrfs_quota_rescan.
Hu Tao (11):
2015 Jun 25
13
[PATCH v2 0/9] Better testing of the guestfsd daemon.
In v2:
- Kernel command line parsing now moved to the appliance.
- In the captive daemon test, the daemon cleanly shuts down on exit.
- Add another btrfs test.
Rich.
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...ount (fs_buf, fs) != 0)
return -1;
return r;
@@ -1412,7 +1412,7 @@ do_btrfs_qgroup_show (const char *path)
return ret;
-error:
+ error:
if (ret->guestfs_int_btrfsqgroup_list_val) {
for (i = 0; i < nr_qgroups; ++i)
free (ret->guestfs_int_btrfsqgroup_list_val[i].btrfsqgroup_id);
@@ -1890,7 +1890,7 @@ do_btrfs_balance_status (const char *path)
pcre_free (re);
return ret;
-error:
+ error:
free (ret->btrfsbalance_status);
free (ret);
pcre_free (re);
@@ -1979,49 +1979,49 @@ do_btrfs_scrub_status (const char *path)
else if (STRPREFIX (lines[i], "...
2015 Oct 05
3
[PATCH 1/2] Change 'fprintf (stdout,...)' -> printf.
Result of earlier copy and paste.
---
align/scan.c | 35 ++++++++++---------
cat/cat.c | 39 +++++++++++----------
cat/filesystems.c | 69 +++++++++++++++++++-------------------
cat/log.c | 35 ++++++++++---------
cat/ls.c | 61 +++++++++++++++++----------------
df/main.c | 43 ++++++++++++------------
diff/diff.c | 67