Displaying 20 results from an estimated 52 matches for "do_btrfs_subvolume_list".
2015 Jun 17
2
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...hanged, 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 (si...
2015 Jun 18
0
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
Hi, Pino
> -----Original Message-----
> From: libguestfs-bounces@redhat.com [mailto:libguestfs-bounces@redhat.com] On
> Behalf Of Pino Toscano
> Sent: Wednesday, June 17, 2015 10:44 PM
> To: libguestfs@redhat.com
> Subject: Re: [Libguestfs] [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return
> value
>
> On Wednesday 17 June 2015 16:19:32 Chen Hanxiao wrote:
> > don't return a value which is to be freed.
> >
> > v4: use strndup
> > v3: v3: fix test case failure
> > Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>...
2015 Jun 17
0
[PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...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);
if (!ret) {
reply_wi...
2015 Jun 18
1
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...ote:
> > -----Original Message-----
> > From: libguestfs-bounces@redhat.com [mailto:libguestfs-bounces@redhat.com] On
> > Behalf Of Pino Toscano
> > Sent: Wednesday, June 17, 2015 10:44 PM
> > To: libguestfs@redhat.com
> > Subject: Re: [Libguestfs] [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return
> > value
> >
> > On Wednesday 17 June 2015 16:19:32 Chen Hanxiao wrote:
> > > don't return a value which is to be freed.
> > >
> > > v4: use strndup
> > > v3: v3: fix test case failure
> > > Signed-off-by: Chen H...
2015 Jun 15
0
[PATCH v3 2/3] do_btrfs_subvolume_list: fix a bad return value
....
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
memmove (line, line + ovecto...
2013 Oct 12
1
[PATCH] btrfs: Fix improper memmove usage in do_btrfs_subvolume_list
...hen it should be relative to src. This fixes some
valgrind warnings I happened across.
---
daemon/btrfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index c3247ac..765dec6 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -473,7 +473,7 @@ do_btrfs_subvolume_list (const mountable_t *fs)
#undef XSTRTOU64
- memmove (line, line + ovector[6], ovector[7] + 1);
+ memmove (line, line + ovector[6], ovector[7] - ovector[6] + 1);
this->btrfssubvolume_path = line;
}
--
1.8.3.1
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
2014 Dec 11
1
Re: [PATCH v2 01/11] daemon: btrfs: add helper functions mount and umount
...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 =...
2014 Dec 12
0
[PATCH v3 01/11] daemon: btrfs: add helper functions mount and umount
...ith_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_PATH) {
- fs_buf = sysr...
2014 Dec 11
0
[PATCH v2 01/11] daemon: btrfs: add helper functions mount and umount
...ith_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_PATH) {
- fs_buf = sysr...
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
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] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...aemon/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 = line;
}
- free (lines)...
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
2013 Jan 24
5
[PATCH] btrfs: Fix btrfs_subvolume_list on F18
...n/btrfs.c b/daemon/btrfs.c
index 8ecde01..a940f0c 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
+#include <pcre.h>
#include <string.h>
#include <unistd.h>
@@ -326,7 +327,7 @@ do_btrfs_subvolume_list (const char *fs)
char *fs_buf;
const char *argv[MAX_ARGS];
size_t i = 0;
- char *out, *err, **lines, *pos;
+ char *out, *err, **lines;
size_t nr_subvolumes;
int r;
@@ -358,13 +359,18 @@ do_btrfs_subvolume_list (const char *fs)
/* Output is:
*
- * ID 256 top level 5 pat...
2015 Jun 12
1
[PATCH v2] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...aemon/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_path = line;
}
- free...
2015 Jun 17
2
[PATCH] btrfs: keep calloc and its error message match
...messages unchanged.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
---
daemon/btrfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 7b14bac..e8059db 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -479,7 +479,7 @@ do_btrfs_subvolume_list (const mountable_t *fs)
ret->guestfs_int_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");...
2015 Jun 23
1
[PATCH] btrfs: remove redundant whitespace
s/ =/ =
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
---
daemon/btrfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 8b5779a..306cade 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -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)...
2014 Oct 16
0
[PATCH] btrfs: list only subvolumes below path
...386-pc $dev /sysroot will succeed.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
daemon/btrfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 7a4d43d..3aceffc 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -356,6 +356,7 @@ do_btrfs_subvolume_list (const mountable_t *fs)
ADD_ARG (argv, i, str_btrfs);
ADD_ARG (argv, i, "subvolume");
ADD_ARG (argv, i, "list");
+ ADD_ARG (argv, i, "-o");
ADD_ARG (argv, i, fs_buf);
ADD_ARG (argv, i, NULL);
@@ -399,7 +400,7 @@ do_btrfs_subvolume_list (co...
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