search for: btrfs_balance_status

Displaying 20 results from an estimated 27 matches for "btrfs_balance_status".

2015 Feb 11
1
Re: [PATCH v3 1/2] New API: btrfs_balance_status
On Wed, Feb 11, 2015 at 06:41:19PM +0800, Chen Hanxiao wrote: > + if (nlines < 1) > + return NULL; This error handling is wrong. It would cause the protocol between the appliance and library to become desynchronized. You have to call one of the error functions -- eg. `reply_with_error' before returning NULL. The rest of this patch looks fine, if this change was made. Rich.
2015 Jun 19
1
[PATCH] btrfs: fix leak in btrfs_balance_status
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> --- daemon/btrfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 050bf18..8b5779a 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1688,8 +1688,8 @@ do_btrfs_balance_status (const char *path) size_t i = 0; CLEANUP_FREE char *path_buf = NULL; CLEANUP_FREE char *err = NULL; + CLEANUP_FREE char *out = NULL; CLEANUP_FREE_STRING_LIST char **lines = NULL; - char *out; int r; guestfs_int_btrfsbalance *ret; size_t nlines; -- 2.1.0
2018 Aug 06
1
[PATCH] btrfs_balance_status: delay allocation of 'ret'
...s possible, so there is no risk that early returns will leak it. --- daemon/btrfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 26757d4fb..5c4be6cf7 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1683,12 +1683,6 @@ do_btrfs_balance_status (const char *path) nlines = guestfs_int_count_strings (lines); - ret = calloc (1, sizeof *ret); - if (ret == NULL) { - reply_with_perror ("calloc"); - return NULL; - } - /* Output of `btrfs balance status' is like: * * running: @@ -1711,6 +1705,12 @@ do_btrf...
2015 Feb 02
0
Re: [PATCH 1/2] New API: btrfs_balance_status
On Mon, Feb 02, 2015 at 02:11:31PM +0800, Hu Tao wrote: [..] So in fact there are a few problems. I couldn't get btrfs balance to actually do anything at all (perhaps it doesn't work on empty filesystems), so this come only from code inspection. > + lines = split_lines (out); > + if (!lines) > + return NULL; > + > + ret = malloc(sizeof *ret); > + if (ret ==
2015 Feb 16
0
Re: [PATCH v5 0/2] add btrfs_balance_status and btrfs_scrub_status
ACK. I will push these later, for real these time. I have a small build problem on my local machine which prevents me from pushing it today. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the
2015 Feb 11
0
[PATCH v3 1/2] New API: btrfs_balance_status
...+- 8 files changed, 151 insertions(+), 1 deletion(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 5cab52a..5cebd91 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1659,3 +1659,126 @@ do_btrfs_rescue_super_recover (const char *device) return 0; } + +guestfs_int_btrfsbalance * +do_btrfs_balance_status (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; + char *out; + int r; + guestfs_int_btrfsbalance *ret; + char **lines; + size_t nlines; + const char *errptr; + int er...
2015 Feb 13
0
[PATCH v4 1/2] New API: btrfs_balance_status
...+- 8 files changed, 154 insertions(+), 1 deletion(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 5cab52a..a979327 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1659,3 +1659,129 @@ do_btrfs_rescue_super_recover (const char *device) return 0; } + +guestfs_int_btrfsbalance * +do_btrfs_balance_status (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; + char *out; + int r; + guestfs_int_btrfsbalance *ret; + char **lines; + size_t nlines; + const char *errptr; + int er...
2015 Feb 13
1
Re: [PATCH v4 1/2] New API: btrfs_balance_status
...> diff --git a/daemon/btrfs.c b/daemon/btrfs.c > index 5cab52a..a979327 100644 > --- a/daemon/btrfs.c > +++ b/daemon/btrfs.c > @@ -1659,3 +1659,129 @@ do_btrfs_rescue_super_recover (const char *device) > > return 0; > } > + > +guestfs_int_btrfsbalance * > +do_btrfs_balance_status (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; > + char *out; > + int r; > + guestfs_int_btrfsbalance *ret; > + char **lines;...
2015 Feb 15
4
[PATCH v5 0/2] add btrfs_balance_status and btrfs_scrub_status
...ix tests failure v4: - add reply_with_error when nlines < 1 - remove `i == X' tests. v3: - rebase on upstream - fix some comments v2: - add check for the length of lines[] - the code parsing 'btrfs scrub -R status' output is changed into a loop Hu Tao (2): New API: btrfs_balance_status New API: btfs_scrub_status daemon/btrfs.c | 270 +++++++++++++++++++++++++++++++ generator/actions.ml | 26 +++ generator/structs.ml | 34 ++++ gobject/Makefile.inc | 4 + java/Makefile.inc...
2015 Feb 03
2
[PATCH v2 0/2] add btrfs_balance_status and btrfs_scrub_status
changes in v2: - add check for the length of lines[] - the code parsing 'btrfs scrub -R status' output is changed into a loop Hu Tao (2): New API: btrfs_balance_status New API: btfs_scrub_status. daemon/btrfs.c | 263 +++++++++++++++++++++++++++++++ generator/actions.ml | 26 +++ generator/structs.ml | 34 ++++ gobject/Makefile.inc | 4 + java/Makefile.inc...
2015 Feb 11
4
[PATCH v3 0/2] add btrfs_balance_status and btrfs_scrub_status
v3: - rebase on upstream - fix some comments v2: - add check for the length of lines[] - the code parsing 'btrfs scrub -R status' output is changed into a loop Hu Tao (2): New API: btrfs_balance_status New API: btfs_scrub_status daemon/btrfs.c | 263 +++++++++++++++++++++++++++++++ generator/actions.ml | 26 +++ generator/structs.ml | 34 ++++ gobject/Makefile.inc | 4 + java/Makefile.inc...
2015 Feb 13
3
[PATCH v4 0/2] add btrfs_balance_status and btrfs_scrub_status
v4: - add reply_with_error when nlines < 1 - remove `i == X' tests. v3: - rebase on upstream - fix some comments v2: - add check for the length of lines[] - the code parsing 'btrfs scrub -R status' output is changed into a loop Hu Tao (2): New API: btrfs_balance_status New API: btfs_scrub_status daemon/btrfs.c | 268 +++++++++++++++++++++++++++++++ generator/actions.ml | 26 +++ generator/structs.ml | 34 ++++ gobject/Makefile.inc | 4 + java/Makefile.inc...
2017 Nov 03
1
[PATCH] daemon: btrfs: fix bad handling of a couple of errors
Remove two wrong error handling situations in btrfs_balance_status: - if the calloc for 'ret' fails, the 'goto error' would try to dereference the resulting null pointer (to free the items of the return struct); hence, just return null directly, instead of jumping to 'error' - if the strdup() for 'btrfsbalance_status' fails, t...
2015 Feb 02
5
[PATCH 1/2] New API: btrfs_balance_status
...+- 8 files changed, 137 insertions(+), 1 deletion(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 796eaff..bb82f32 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1659,3 +1659,112 @@ do_btrfs_rescue_super_recover (const char *device) return 0; } + +guestfs_int_btrfsbalance * +do_btrfs_balance_status (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; + char *out; + int r; + guestfs_int_btrfsbalance *ret; + char **lines; + const char *errptr; + int erroffset; +#define...
2015 Jan 27
2
Re: [PATCH 00/16] btrfs: add support to btrfs scrub, balance, rescue and inspect
On Wed, Jan 21, 2015 at 01:58:02PM +0000, Richard W.M. Jones wrote: > On Fri, Jan 16, 2015 at 10:23:35AM +0800, Hu Tao wrote: > [...] > > Thanks for these patches. I will push all of them shortly *except*: Thanks! > > > New API: btrfs_balance_status > > New API: btrfs_scrub_status > > - These ones currently dump the status into a string. Generally it's > better (although a huge pain) to translate the output of the commands > into structures. The reason is that if we don't do this then we end > up pushing parsi...
2015 Jan 16
18
[PATCH 00/16] btrfs: add support to btrfs scrub, balance, rescue and inspect
...balance, rescue and inspect. Some of them don't have tests because: - btrfs_scrub and btrfs_balance completes too early before we can test btrfs_scrub_cancel, btrfs_scrub_resume, btrfs_scrub_status, btrfs_balance_pause, btrfs_balance_cancel, btrfs_balance_resume and btrfs_balance_status. - can't determine a valid logical address for test btrfs_inspect_logical_resolve. Thank you very much for review! Regards, Hu Hu Tao (16): New API: btrfs_scrub New API: btrfs_scrub_cancel New API: btrfs_scrub_resume btrfs: replace "btrfs filesystem balance" wit...
2015 Jan 21
0
Re: [PATCH 00/16] btrfs: add support to btrfs scrub, balance, rescue and inspect
On Fri, Jan 16, 2015 at 10:23:35AM +0800, Hu Tao wrote: [...] Thanks for these patches. I will push all of them shortly *except*: > New API: btrfs_balance_status > New API: btrfs_scrub_status - These ones currently dump the status into a string. Generally it's better (although a huge pain) to translate the output of the commands into structures. The reason is that if we don't do this then we end up pushing parsing to every consumer of libgue...
2015 Jan 27
0
Re: [PATCH 00/16] btrfs: add support to btrfs scrub, balance, rescue and inspect
...Wed, Jan 21, 2015 at 01:58:02PM +0000, Richard W.M. Jones wrote: > > On Fri, Jan 16, 2015 at 10:23:35AM +0800, Hu Tao wrote: > > [...] > > > > Thanks for these patches. I will push all of them shortly *except*: > > Thanks! > > > > > > New API: btrfs_balance_status > > > New API: btrfs_scrub_status > > > > - These ones currently dump the status into a string. Generally it's > > better (although a huge pain) to translate the output of the commands > > into structures. The reason is that if we don't do this then we...
2017 Feb 21
1
[PATCH] generator: Put all the daemon procedure numbers (proc_nr)
This is a follow-up to the other generator changes in: https://www.redhat.com/archives/libguestfs/2017-February/msg00217.html Rich.
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...uot;, [String (Device, "device"); Int "partnum"], []; optional = Some "gdisk"; tests = [ InitGPT, Always, TestResultString ( @@ -9277,7 +9277,7 @@ Return the GUID of numbered GPT partition C<partnum>." }; { defaults with name = "btrfs_balance_status"; added = (1, 29, 26); - style = RStruct ("status", "btrfsbalance"), [Pathname "path"], []; + style = RStruct ("status", "btrfsbalance"), [String (Pathname, "path")], []; optional = Some "btrfs"; camel_name = &quo...