search for: nr_filesystem_show

Displaying 3 results from an estimated 3 matches for "nr_filesystem_show".

2015 Jun 11
2
[PATCH] New API: btrfs_filesystem_show_all
...a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -2083,3 +2083,179 @@ do_btrfs_image (char *const *sources, const char *image, return 0; } + +guestfs_int_btrfsfsshow_list * +do_btrfs_filesystem_show_all (void) +{ + const size_t MAX_ARGS = 64; + const char *argv[MAX_ARGS]; + size_t i = 0; + size_t nr_filesystem_show = 0; + CLEANUP_FREE char *err = NULL; + char *out = NULL; + char **lines; + int r; + /* Info from Label line will be reused for the following devid line + * make two temp space to hold them */ + char *label_tmp = NULL, *uuid_tmp = NULL; + + ADD_ARG (argv, i, str_btrfs); + ADD_ARG (argv, i...
2015 Jun 11
0
Re: [PATCH] New API: btrfs_filesystem_show_all
...gt; +do_btrfs_filesystem_show_all (void) Why the _all suffix? If this is about showing the information of a device, just use a more clear name than just wrapping the btrfs command. > +{ > + const size_t MAX_ARGS = 64; > + const char *argv[MAX_ARGS]; > + size_t i = 0; > + size_t nr_filesystem_show = 0; > + CLEANUP_FREE char *err = NULL; > + char *out = NULL; "out" will be leaked, so make it CLEANUP_FREE and don't free it manually. > + char **lines; "lines" can be leaked and it isn't freed properly (only the array itself on success, and array and str...
2015 Jun 11
1
Re: [PATCH] New API: btrfs_filesystem_show_all
...e is another function which could specify device, but as we discussed before, thought that scenario did not bring some benefit So I posted a _all API. > > > +{ > > + const size_t MAX_ARGS = 64; > > + const char *argv[MAX_ARGS]; > > + size_t i = 0; > > + size_t nr_filesystem_show = 0; > > + CLEANUP_FREE char *err = NULL; > > + char *out = NULL; > > "out" will be leaked, so make it CLEANUP_FREE and don't free it > manually. > OK. > > + char **lines; > > "lines" can be leaked and it isn't freed properly (...