Displaying 20 results from an estimated 30 matches for "nr_subvolum".
Did you mean:
nr_subvolumes
2013 Jan 24
5
[PATCH] btrfs: Fix btrfs_subvolume_list on F18
...<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 path test1
- * ID 257 top level 5 path dir/test2
- * ID 258 top level 5 path test3
+ * ID 256 gen 30 top level 5 path test1
+ * ID 257 gen 30 top level 5 path dir/...
2015 Jun 17
2
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...GS];
> @@ -472,7 +472,7 @@ do_btrfs_subvolume_list (const mountable_t *fs)
> ret = malloc (sizeof *ret);
> if (!ret) {
> reply_with_perror ("malloc");
> - goto error;
> + return NULL;
> }
>
> ret->guestfs_int_btrfssubvolume_list_len = nr_subvolumes;
> @@ -480,7 +480,8 @@ do_btrfs_subvolume_list (const mountable_t *fs)
> calloc (nr_subvolumes, sizeof (struct guestfs_int_btrfssubvolume));
> if (ret->guestfs_int_btrfssubvolume_list_val == NULL) {
> reply_with_perror ("malloc");
> - goto error;
> +...
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 17
0
[PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...e_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_with_perror ("malloc");
- goto error;
+ return NULL;
}
ret->guestfs_int_btrfssubvolume_list_len = nr_subvolumes;
@@ -480,7 +480,8 @@ do_btrfs_subvolume_list (const mountable_t *fs)
calloc (nr_subvolumes, sizeof (struct guestfs_int_btrfssubvolume));
if (ret->guestfs_int_btrfssubvolume_list_val == NULL) {
reply_with_perror ("malloc");
- goto error;
+ free (ret);
+ return NU...
2015 Jun 18
0
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
..._subvolume_list (const mountable_t *fs)
> > ret = malloc (sizeof *ret);
> > if (!ret) {
> > reply_with_perror ("malloc");
> > - goto error;
> > + return NULL;
> > }
> >
> > ret->guestfs_int_btrfssubvolume_list_len = nr_subvolumes;
> > @@ -480,7 +480,8 @@ do_btrfs_subvolume_list (const mountable_t *fs)
> > calloc (nr_subvolumes, sizeof (struct guestfs_int_btrfssubvolume));
> > if (ret->guestfs_int_btrfssubvolume_list_val == NULL) {
> > reply_with_perror ("malloc");
> >...
2015 Jun 18
1
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...> > > ret = malloc (sizeof *ret);
> > > if (!ret) {
> > > reply_with_perror ("malloc");
> > > - goto error;
> > > + return NULL;
> > > }
> > >
> > > ret->guestfs_int_btrfssubvolume_list_len = nr_subvolumes;
> > > @@ -480,7 +480,8 @@ do_btrfs_subvolume_list (const mountable_t *fs)
> > > calloc (nr_subvolumes, sizeof (struct guestfs_int_btrfssubvolume));
> > > if (ret->guestfs_int_btrfssubvolume_list_val == NULL) {
> > > reply_with_perror ("mal...
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
2017 Jul 21
0
[PATCH v2 15/23] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...the
- * filesystem.
- *
- * Note that the order that each of the above is fixed, but
- * different versions of btrfs may display different sets of data.
- * Specifically, older versions of btrfs do not display gen.
- */
-
- guestfs_int_btrfssubvolume_list *ret = NULL;
-
- const size_t nr_subvolumes = guestfs_int_count_strings (lines);
-
- ret = malloc (sizeof *ret);
- if (!ret) {
- reply_with_perror ("malloc");
- return NULL;
- }
-
- ret->guestfs_int_btrfssubvolume_list_len = nr_subvolumes;
- ret->guestfs_int_btrfssubvolume_list_val =
- calloc (nr_subvolumes, s...
[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.
...the
- * filesystem.
- *
- * Note that the order that each of the above is fixed, but
- * different versions of btrfs may display different sets of data.
- * Specifically, older versions of btrfs do not display gen.
- */
-
- guestfs_int_btrfssubvolume_list *ret = NULL;
-
- const size_t nr_subvolumes = guestfs_int_count_strings (lines);
-
- ret = malloc (sizeof *ret);
- if (!ret) {
- reply_with_perror ("malloc");
- return NULL;
- }
-
- ret->guestfs_int_btrfssubvolume_list_len = nr_subvolumes;
- ret->guestfs_int_btrfssubvolume_list_val =
- calloc (nr_subvolumes, s...
2015 Jun 17
2
[PATCH] btrfs: keep calloc and its error message match
...--
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");
goto error;
}
@@ -1292,7 +1292,7 @@ do_btrfs_qgroup_show (const char *path)
ret->gu...
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 12
1
[PATCH] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...ar **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);
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...
2015 Jun 12
1
[PATCH v2] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...nes = 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 (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_STRI...
2015 Jun 15
0
[PATCH v3 2/3] do_btrfs_subvolume_list: fix a bad return value
...+ ovector[6], ovector[7] - ovector[6] + 1);
- this->btrfssubvolume_path = line;
+ this->btrfssubvolume_path = strdup (line);
+ if (this->btrfssubvolume_path == NULL)
+ goto error;
}
- 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);
--
2.1.0
2015 Jun 17
0
Re: [PATCH] btrfs: keep calloc and its error message match
...eletions(-)
>
> 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");
> goto error;
> }
>
> @@ -1292,7 +1292,7 @@ do_btrfs_qgroup_sh...
2015 Nov 09
6
[PATCH 0/5] build: Enable some more warnings.
Add some warnings. Well, the first patch is a miscellaneous
change, but patches 2-5 add some warnings.
Rich.
2017 Jun 19
0
[PATCH v7 13/13] daemon: Link guestfsd with libutils.
...);
+ 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_add_needs_force = -1;
- const size_t nr_de...
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(-)
2017 Jun 05
19
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
v2 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00008.html
This series gets as far as a working (and faster) reimplementation of
‘guestfs_list_filesystems’.
I also have another patch series on top of this one which reimplements
the inspection APIs inside the daemon, but that needs a bit more work
still, since inspection turns out to be a very large piece of code.
Rich.
2017 Jul 27
23
[PATCH v3 00/23] Reimplement many daemon APIs in OCaml.
I think this fixes everything mentioned:
- Added the Optgroups module as suggested.
- Remove command temporary files.
- Replace command ~flags with ?fold_stdout_on_stderr.
- Nest _with_mounted function.
- Rebase & retest.
Rich.