Displaying 20 results from an estimated 32 matches for "guestfs_int_btrfssubvolume_list".
2013 Jan 24
5
[PATCH] btrfs: Fix btrfs_subvolume_list on F18
..."top level\\s+(\\d+).*\\s"
+ "path\\s(.*)",
+ 0, &errptr, &erroffset, NULL);
+ if (re == NULL) {
+ reply_with_error ("pcre_compile (%i): %s", erroffset, errptr);
+ free (ret->guestfs_int_btrfssubvolume_list_val);
+ free (ret);
+ free_stringslen (lines, nr_subvolumes);
+ return NULL;
+ }
+
for (i = 0; i < nr_subvolumes; ++i) {
/* To avoid allocations, reuse the 'line' buffer to store the
* path. Thus we don't need to free 'line', since it will be
*...
2015 Jun 12
1
[PATCH] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...enhanxiao@cn.fujitsu.com>
---
daemon/btrfs.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 39392f7..fd93d43 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -409,7 +409,7 @@ umount (char *fs_buf, const mountable_t *fs)
guestfs_int_btrfssubvolume_list *
do_btrfs_subvolume_list (const mountable_t *fs)
{
- char **lines;
+ CLEANUP_FREE_STRING_LIST char **lines;
size_t i = 0;
const size_t MAX_ARGS = 64;
const char *argv[MAX_ARGS];
@@ -534,13 +534,11 @@ do_btrfs_subvolume_list (const mountable_t *fs)
this->btrfssubvolume_path = l...
2015 Jun 17
2
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...++++++++++++++++---------
> 1 file changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/daemon/btrfs.c b/daemon/btrfs.c
> index 8d03caa..5361984 100644
> --- a/daemon/btrfs.c
> +++ b/daemon/btrfs.c
> @@ -409,7 +409,7 @@ umount (char *fs_buf, const mountable_t *fs)
> guestfs_int_btrfssubvolume_list *
> do_btrfs_subvolume_list (const mountable_t *fs)
> {
> - char **lines;
> + CLEANUP_FREE_STRING_LIST char **lines = NULL;
> size_t i = 0;
> const size_t MAX_ARGS = 64;
> const char *argv[MAX_ARGS];
> @@ -472,7 +472,7 @@ do_btrfs_subvolume_list (const mountable...
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(-)
2014 Dec 11
1
Re: [PATCH v2 01/11] daemon: btrfs: add helper functions mount and umount
...? err : "malloc");
> + return -1;
> + }
> +
> + if (rmdir (fs_buf) == -1 && errno != ENOENT) {
> + reply_with_error ("rmdir: %m\n");
> + return -1;
> + }
> + }
> + free (fs_buf);
> + return 0;
> +}
> +
> guestfs_int_btrfssubvolume_list *
> do_btrfs_subvolume_list (const mountable_t *fs)
> {
> @@ -336,42 +386,10 @@ do_btrfs_subvolume_list (const mountable_t *fs)
>
> /* Execute 'btrfs subvolume list <fs>', and split the output into lines */
> {
> - CLEANUP_FREE char *fs_buf = NULL;
&g...
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
2017 Jul 21
0
[PATCH v2 15/23] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...- "top level\\s+(\\d+).*\\s"
- "path\\s(.*)",
- 0)
COMPILE_REGEXP (re_btrfs_balance_status, "Balance on '.*' is (.*)", 0)
int
@@ -483,137 +478,6 @@ umount (char *fs_buf, const mountable_t *fs)
return 0;
}
-guestfs_int_btrfssubvolume_list *
-do_btrfs_subvolume_list (const mountable_t *fs)
-{
- CLEANUP_FREE_STRING_LIST char **lines = NULL;
- size_t i = 0;
- const size_t MAX_ARGS = 64;
- const char *argv[MAX_ARGS];
-
- /* Execute 'btrfs subvolume list <fs>', and split the output into lines */
- {
- char *fs_buf...
[PATCH 18/27] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
2017 Jul 14
0
[PATCH 18/27] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...- "top level\\s+(\\d+).*\\s"
- "path\\s(.*)",
- 0)
COMPILE_REGEXP (re_btrfs_balance_status, "Balance on '.*' is (.*)", 0)
int
@@ -483,137 +478,6 @@ umount (char *fs_buf, const mountable_t *fs)
return 0;
}
-guestfs_int_btrfssubvolume_list *
-do_btrfs_subvolume_list (const mountable_t *fs)
-{
- CLEANUP_FREE_STRING_LIST char **lines = NULL;
- size_t i = 0;
- const size_t MAX_ARGS = 64;
- const char *argv[MAX_ARGS];
-
- /* Execute 'btrfs subvolume list <fs>', and split the output into lines */
- {
- char *fs_buf...
2015 Jun 12
1
[PATCH v2] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...LEANUP_FREE_STRING_LIST to null
daemon/btrfs.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 39392f7..3ca39ab 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -409,7 +409,7 @@ umount (char *fs_buf, const mountable_t *fs)
guestfs_int_btrfssubvolume_list *
do_btrfs_subvolume_list (const mountable_t *fs)
{
- char **lines;
+ CLEANUP_FREE_STRING_LIST char **lines = NULL;
size_t i = 0;
const size_t MAX_ARGS = 64;
const char *argv[MAX_ARGS];
@@ -534,13 +534,11 @@ do_btrfs_subvolume_list (const mountable_t *fs)
this->btrfssubvolume_p...
2015 Jun 15
0
[PATCH v3 2/3] do_btrfs_subvolume_list: fix a bad return value
...on'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 5011ec4..c1462fd 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -409,7 +409,7 @@ umount (char *fs_buf, const mountable_t *fs)
guestfs_int_btrfssubvolume_list *
do_btrfs_subvolume_list (const mountable_t *fs)
{
- char **lines;
+ CLEANUP_FREE_STRING_LIST char **lines = NULL;
size_t i = 0;
const size_t MAX_ARGS = 64;
const char *argv[MAX_ARGS];
@@ -531,16 +531,16 @@ do_btrfs_subvolume_list (const mountable_t *fs)
#undef XSTRTOU64
m...
2015 Jun 17
0
[PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...jitsu.com>
---
daemon/btrfs.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 8d03caa..5361984 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -409,7 +409,7 @@ umount (char *fs_buf, const mountable_t *fs)
guestfs_int_btrfssubvolume_list *
do_btrfs_subvolume_list (const mountable_t *fs)
{
- char **lines;
+ CLEANUP_FREE_STRING_LIST char **lines = NULL;
size_t i = 0;
const size_t MAX_ARGS = 64;
const char *argv[MAX_ARGS];
@@ -472,7 +472,7 @@ do_btrfs_subvolume_list (const mountable_t *fs)
ret = malloc (sizeof *ret);...
2015 Jun 18
0
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...file changed, 17 insertions(+), 9 deletions(-)
> >
> > diff --git a/daemon/btrfs.c b/daemon/btrfs.c
> > index 8d03caa..5361984 100644
> > --- a/daemon/btrfs.c
> > +++ b/daemon/btrfs.c
> > @@ -409,7 +409,7 @@ umount (char *fs_buf, const mountable_t *fs)
> > guestfs_int_btrfssubvolume_list *
> > do_btrfs_subvolume_list (const mountable_t *fs)
> > {
> > - char **lines;
> > + CLEANUP_FREE_STRING_LIST char **lines = NULL;
> > size_t i = 0;
> > const size_t MAX_ARGS = 64;
> > const char *argv[MAX_ARGS];
> > @@ -472,7 +472,7 @@...
2014 Dec 12
0
[PATCH v3 01/11] daemon: btrfs: add helper functions mount and umount
..._buf, NULL) == -1) {
+ reply_with_error ("%s", err ? err : "malloc");
+ return -1;
+ }
+
+ if (rmdir (fs_buf) == -1 && errno != ENOENT) {
+ reply_with_error ("rmdir: %m\n");
+ return -1;
+ }
+ }
+ free (fs_buf);
+ return 0;
+}
+
guestfs_int_btrfssubvolume_list *
do_btrfs_subvolume_list (const mountable_t *fs)
{
@@ -336,42 +388,10 @@ do_btrfs_subvolume_list (const mountable_t *fs)
/* Execute 'btrfs subvolume list <fs>', and split the output into lines */
{
- CLEANUP_FREE char *fs_buf = NULL;
-
- if (fs->type == MOUNTABLE_P...
2014 Dec 11
0
[PATCH v2 01/11] daemon: btrfs: add helper functions mount and umount
..._buf, NULL) == -1) {
+ reply_with_error ("%s", err ? err : "malloc");
+ return -1;
+ }
+
+ if (rmdir (fs_buf) == -1 && errno != ENOENT) {
+ reply_with_error ("rmdir: %m\n");
+ return -1;
+ }
+ }
+ free (fs_buf);
+ return 0;
+}
+
guestfs_int_btrfssubvolume_list *
do_btrfs_subvolume_list (const mountable_t *fs)
{
@@ -336,42 +386,10 @@ do_btrfs_subvolume_list (const mountable_t *fs)
/* Execute 'btrfs subvolume list <fs>', and split the output into lines */
{
- CLEANUP_FREE char *fs_buf = NULL;
-
- if (fs->type == MOUNTABLE_P...
2015 Jun 18
2
[PATCH v5 1/2] do_btrfs_qgroup_show: fix a bad return value
We should not use temporary lines buffer as return value,
for lines buffer will be freed.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
---
v5: modify according to Pino's comments
v4: take advantage of sscanf's '%m'.
v3: fix test case failure
daemon/btrfs.c | 34 ++++++++++++++--------------------
1 file changed, 14 insertions(+), 20 deletions(-)
diff --git
2015 Jun 18
1
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...eletions(-)
> > >
> > > diff --git a/daemon/btrfs.c b/daemon/btrfs.c
> > > index 8d03caa..5361984 100644
> > > --- a/daemon/btrfs.c
> > > +++ b/daemon/btrfs.c
> > > @@ -409,7 +409,7 @@ umount (char *fs_buf, const mountable_t *fs)
> > > guestfs_int_btrfssubvolume_list *
> > > do_btrfs_subvolume_list (const mountable_t *fs)
> > > {
> > > - char **lines;
> > > + CLEANUP_FREE_STRING_LIST char **lines = NULL;
> > > size_t i = 0;
> > > const size_t MAX_ARGS = 64;
> > > const char *argv[MAX_AR...
2016 Feb 23
3
[PATCH 1/2] lib: Allow the COMPILE_REGEXP macro to be used everywhere.
Since the daemon links to pcre and use regular expressions, and since
the COMPILE_REGEXP macro doesn't depend on any aspects of the
library-side code (eg. the guestfs_h handle etc), we can allow the
daemon to use the COMPILE_REGEXP macro. Move the macro to
"guestfs-internal-all.h" to permit this.
---
src/guestfs-internal-all.h | 26 ++++++++++++++++++++++++++
src/guestfs-internal.h
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
2017 Jun 19
0
[PATCH v7 13/13] daemon: Link guestfsd with libutils.
...torsize)
{
- const size_t nr_devices = count_strings (devices);
+ const size_t nr_devices = guestfs_int_count_strings (devices);
const size_t MAX_ARGS = nr_devices + 64;
const char *argv[MAX_ARGS];
size_t i = 0, j;
@@ -500,7 +500,7 @@ do_btrfs_subvolume_list (const mountable_t *fs)
guestfs_int_btrfssubvolume_list *ret = NULL;
- const size_t nr_subvolumes = count_strings (lines);
+ const size_t nr_subvolumes = guestfs_int_count_strings (lines);
ret = malloc (sizeof *ret);
if (!ret) {
@@ -733,7 +733,7 @@ int
do_btrfs_device_add (char *const *devices, const char *fs)
{
static int btrfs_device_...
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):