search for: subvolume_buf

Displaying 20 results from an estimated 22 matches for "subvolume_buf".

2015 Jun 16
1
[PATCH] btrfs: remove unused 'out' variables
...- r = commandv (&out, &err, argv); + r = commandv (NULL, &err, argv); if (r == -1) { reply_with_error ("%s: %s", fs_buf, err); goto error; @@ -1118,7 +1116,6 @@ do_btrfs_qgroup_limit (const char *subvolume, int64_t size) size_t i = 0; CLEANUP_FREE char *subvolume_buf = NULL; CLEANUP_FREE char *err = NULL; - CLEANUP_FREE char *out = NULL; char size_str[32]; int r; @@ -1136,7 +1133,7 @@ do_btrfs_qgroup_limit (const char *subvolume, int64_t size) ADD_ARG (argv, i, subvolume_buf); ADD_ARG (argv, i, NULL); - r = commandv (&out, &err, arg...
2014 Dec 02
0
[PATCH 6/8] New API: btrfs_qgroup_limit
...a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1088,3 +1088,35 @@ int do_btrfs_quota_rescan (const char *path) return 0; } + +int do_btrfs_qgroup_limit (const char *subvolume, const char *size) +{ + const size_t MAX_ARGS = 64; + const char *argv[MAX_ARGS]; + size_t i = 0; + CLEANUP_FREE char *subvolume_buf = NULL; + CLEANUP_FREE char *err = NULL; + CLEANUP_FREE char *out = NULL; + int r; + + subvolume_buf = sysroot_path (subvolume); + if (subvolume_buf == NULL) { + reply_with_perror ("malloc"); + return -1; + } + + ADD_ARG (argv, i, str_btrfs); + ADD_ARG (argv, i, "qgroup...
2014 Dec 02
0
[PATCH 7/8] New API: btrfs_qgroup_create
...on/btrfs.c @@ -1120,3 +1120,35 @@ int do_btrfs_qgroup_limit (const char *subvolume, const char *size) return 0; } + +int do_btrfs_qgroup_create (const char *qgroupid, const char *subvolume) +{ + const size_t MAX_ARGS = 64; + const char *argv[MAX_ARGS]; + size_t i = 0; + CLEANUP_FREE char *subvolume_buf = NULL; + CLEANUP_FREE char *err = NULL; + CLEANUP_FREE char *out = NULL; + int r; + + subvolume_buf = sysroot_path (subvolume); + if (subvolume_buf == NULL) { + reply_with_perror ("malloc"); + return -1; + } + + ADD_ARG (argv, i, str_btrfs); + ADD_ARG (argv, i, "qgroup...
2014 Nov 21
3
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...@@ do_btrfs_fsck (const char *device, int64_t superblock, int repair) > > return 0; > } > + > +char **do_btrfs_subvolume_show (const char *subvolume) > +{ > + const size_t MAX_ARGS = 64; > + const char *argv[MAX_ARGS]; > + size_t i = 0; > + CLEANUP_FREE char *subvolume_buf = NULL; > + CLEANUP_FREE char *err = NULL; > + CLEANUP_FREE char *out = NULL; > + char *p, *pend, *colon; > + DECLARE_STRINGSBUF (ret); > + int r; > + > + subvolume_buf = sysroot_path (subvolume); > + if (subvolume_buf == NULL) { > + reply_with_perror ("mal...
2014 Nov 24
1
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...gt; > > } > > > > > > + > > > +char **do_btrfs_subvolume_show (const char *subvolume) > > > +{ > > > + const size_t MAX_ARGS = 64; > > > + const char *argv[MAX_ARGS]; > > > + size_t i = 0; > > > + CLEANUP_FREE char *subvolume_buf = NULL; > > > + CLEANUP_FREE char *err = NULL; > > > + CLEANUP_FREE char *out = NULL; > > > + char *p, *pend, *colon; > > > + DECLARE_STRINGSBUF (ret); > > > + int r; > > > + > > > + subvolume_buf = sysroot_path (subvolume); >...
2014 Nov 21
0
[PATCH 6/6] New API: btrfs_subvolume_show
...CMD(str_btrfstune, btrfstune); @@ -813,3 +814,169 @@ do_btrfs_fsck (const char *device, int64_t superblock, int repair) return 0; } + +char **do_btrfs_subvolume_show (const char *subvolume) +{ + const size_t MAX_ARGS = 64; + const char *argv[MAX_ARGS]; + size_t i = 0; + CLEANUP_FREE char *subvolume_buf = NULL; + CLEANUP_FREE char *err = NULL; + CLEANUP_FREE char *out = NULL; + char *p, *pend, *colon; + DECLARE_STRINGSBUF (ret); + int r; + + subvolume_buf = sysroot_path (subvolume); + if (subvolume_buf == NULL) { + reply_with_perror ("malloc"); + return NULL; + } + + ADD_A...
2014 Dec 02
21
[PATCH 0/8] btrfs support part2: qgroup commands
Hi, This series adds support to btrfs qgroup related commands, inclduing quota commands, and two leftover of subvolume commands. Regards, Hu Hu Tao (8): New API: btrfs_subvolume_get_default New API: btrfs_subvolume_show New API: btrfs_quota_enable New API: btrfs_quota_disable New API: btrfs_quota_rescan New API: btrfs_qgroup_limit New API: btrfs_qgroup_create New API:
2014 Dec 02
0
[PATCH 2/8] New API: btrfs_subvolume_show
...*del_pos && c_isspace (*del_pos)); + assert (value); + *value = del_pos; + } else + *value = NULL; + + return next; +} + +char **do_btrfs_subvolume_show (const char *subvolume) +{ + const size_t MAX_ARGS = 64; + const char *argv[MAX_ARGS]; + size_t i = 0; + CLEANUP_FREE char *subvolume_buf = NULL; + CLEANUP_FREE char *err = NULL; + CLEANUP_FREE char *out = NULL; + char *p, *key = NULL, *value = NULL; + DECLARE_STRINGSBUF (ret); + int r; + + subvolume_buf = sysroot_path (subvolume); + if (subvolume_buf == NULL) { + reply_with_perror ("malloc"); + return NULL; +...
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
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):
2014 Dec 05
1
Re: [PATCH 2/8] New API: btrfs_subvolume_show
...ue); > + *value = del_pos; > + } else > + *value = NULL; > + > + return next; > +} > +char **do_btrfs_subvolume_show (const char *subvolume) > +{ > + const size_t MAX_ARGS = 64; > + const char *argv[MAX_ARGS]; > + size_t i = 0; > + CLEANUP_FREE char *subvolume_buf = NULL; > + CLEANUP_FREE char *err = NULL; > + CLEANUP_FREE char *out = NULL; > + char *p, *key = NULL, *value = NULL; > + DECLARE_STRINGSBUF (ret); > + int r; > + > + subvolume_buf = sysroot_path (subvolume); > + if (subvolume_buf == NULL) { > + reply_with_perr...
2014 Nov 24
0
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...rblock, int repair) > > > > return 0; > > } > > + > > +char **do_btrfs_subvolume_show (const char *subvolume) > > +{ > > + const size_t MAX_ARGS = 64; > > + const char *argv[MAX_ARGS]; > > + size_t i = 0; > > + CLEANUP_FREE char *subvolume_buf = NULL; > > + CLEANUP_FREE char *err = NULL; > > + CLEANUP_FREE char *out = NULL; > > + char *p, *pend, *colon; > > + DECLARE_STRINGSBUF (ret); > > + int r; > > + > > + subvolume_buf = sysroot_path (subvolume); > > + if (subvolume_buf == NULL)...
2014 Nov 21
13
[PATCH 0/6] btrfs support part1: subvolume commands
Hi, This is the part1 of improving btrfs support. This series adds missing parameters to btrfs_subvolume_snapshot and btrfs_subvolume_create, and adds two new API btrfs_subvolume_get_default and btrfs_subvolume_show. Other parts will follow. Regards, Hu Hu Tao (6): btrfs: correct words about subvolume and snapshot btrfs: add optional parameter `ro' to btrfs_subvolume_snapshot btrfs:
2014 Nov 26
7
[PATCH v2 0/5] btrfs support part1: subvolume commands
Hi, This is the part1 of improving btrfs support. This series adds missing parameters to btrfs_subvolume_snapshot and btrfs_subvolume_create, and adds two new API btrfs_subvolume_get_default and btrfs_subvolume_show. Other parts will follow. Regards, Hu changes: v2: - add 'once_had_no_optargs = true' for btrfs_subvolume_snapshot and btrfs_subvolume_create - improved documents
2016 Jul 07
0
[PATCH 2/2] daemon: fix cleanup of stringsbuf usages
...s.c +++ b/daemon/btrfs.c @@ -1016,7 +1016,7 @@ do_btrfs_subvolume_show (const char *subvolume) CLEANUP_FREE char *err = NULL; CLEANUP_FREE char *out = NULL; char *p, *key = NULL, *value = NULL; - DECLARE_STRINGSBUF (ret); + CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (ret); int r; subvolume_buf = sysroot_path (subvolume); @@ -1147,7 +1147,7 @@ do_btrfs_subvolume_show (const char *subvolume) if (end_stringsbuf (&ret) == -1) return NULL; - return ret.argv; + return take_stringsbuf (&ret); } int diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 41c728c..c750c...
2016 Jul 07
2
[PATCH 1/2] daemon: free the string on stringsbuf add failure
If add_string_nodup fails free the passed string instead of leaking it, as that string would have been owned by the stringbuf. Adapt few places to this behaviour. --- daemon/btrfs.c | 4 +--- daemon/devsparts.c | 8 ++++---- daemon/guestfsd.c | 1 + 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 9b52aa8..d70565a 100644 ---
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
..."snapshot"); @@ -333,7 +326,7 @@ do_btrfs_subvolume_delete (const char *subvolume) return -1; } - ADD_ARG (argv, i, str_btrfs); + ADD_ARG (argv, i, "btrfs"); ADD_ARG (argv, i, "subvolume"); ADD_ARG (argv, i, "delete"); ADD_ARG (argv, i, subvolume_buf); @@ -364,7 +357,7 @@ do_btrfs_subvolume_create (const char *dest, const char *qgroupid) return -1; } - ADD_ARG (argv, i, str_btrfs); + ADD_ARG (argv, i, "btrfs"); ADD_ARG (argv, i, "subvolume"); ADD_ARG (argv, i, "create"); @@ -426,7 +419,7 @@ umou...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
..."snapshot"); @@ -333,7 +329,7 @@ do_btrfs_subvolume_delete (const char *subvolume) return -1; } - ADD_ARG (argv, i, str_btrfs); + ADD_ARG (argv, i, "btrfs"); ADD_ARG (argv, i, "subvolume"); ADD_ARG (argv, i, "delete"); ADD_ARG (argv, i, subvolume_buf); @@ -364,7 +360,7 @@ do_btrfs_subvolume_create (const char *dest, const char *qgroupid) return -1; } - ADD_ARG (argv, i, str_btrfs); + ADD_ARG (argv, i, "btrfs"); ADD_ARG (argv, i, "subvolume"); ADD_ARG (argv, i, "create"); @@ -426,7 +422,7 @@ umou...
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...G (argv, i, source_buf); @@ -261,7 +266,7 @@ do_btrfs_subvolume_delete (const char *subvolume) return -1; } - ADD_ARG (argv, i, "btrfs"); + ADD_ARG (argv, i, str_btrfs); ADD_ARG (argv, i, "subvolume"); ADD_ARG (argv, i, "delete"); ADD_ARG (argv, i, subvolume_buf); @@ -295,7 +300,7 @@ do_btrfs_subvolume_create (const char *dest) return -1; } - ADD_ARG (argv, i, "btrfs"); + ADD_ARG (argv, i, str_btrfs); ADD_ARG (argv, i, "subvolume"); ADD_ARG (argv, i, "create"); ADD_ARG (argv, i, dest_buf); @@ -331,7 +336,7...
2012 Aug 30
1
[PATCH] collect list of called external commands
...G (argv, i, source_buf); @@ -261,7 +266,7 @@ do_btrfs_subvolume_delete (const char *subvolume) return -1; } - ADD_ARG (argv, i, "btrfs"); + ADD_ARG (argv, i, str_btrfs); ADD_ARG (argv, i, "subvolume"); ADD_ARG (argv, i, "delete"); ADD_ARG (argv, i, subvolume_buf); @@ -295,7 +300,7 @@ do_btrfs_subvolume_create (const char *dest) return -1; } - ADD_ARG (argv, i, "btrfs"); + ADD_ARG (argv, i, str_btrfs); ADD_ARG (argv, i, "subvolume"); ADD_ARG (argv, i, "create"); ADD_ARG (argv, i, dest_buf); @@ -331,7 +336,7...