Displaying 20 results from an estimated 131 matches for "str_btrfs".
2015 Mar 16
2
[PATCH] btrfs-qgroup-show: add check for "--raw"
...* 'btrfs qgroup show' support --help' command.
+ */
+static int
+test_btrfs_qgroup_show_raw_opt (void)
+{
+ static int result = -1;
+ if (result > 0)
+ return result;
+
+ CLEANUP_FREE char *err = NULL;
+ CLEANUP_FREE char *out = NULL;
+
+ int r = commandr (&out, &err, str_btrfs, "qgroup", "show", "--help", NULL);
+
+ if (r == -1) {
+ reply_with_error ("btrfs qgroup show --help: %s", err);
+ return -1;
+ }
+
+ if (!strstr (out, "--raw"))
+ result = 0;
+
+ return result;
+}
+
guestfs_int_btrfsqgroup_list *
d...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...blockdev,
+ "blockdev",
switc,
NULL,
NULL,
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 5f1e5d1d0..8fd327c09 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -33,13 +33,6 @@
#include "c-ctype.h"
#include "ignore-value.h"
-GUESTFSD_EXT_CMD(str_btrfs, btrfs);
-GUESTFSD_EXT_CMD(str_btrfstune, btrfstune);
-GUESTFSD_EXT_CMD(str_btrfsck, btrfsck);
-GUESTFSD_EXT_CMD(str_mkfs_btrfs, mkfs.btrfs);
-GUESTFSD_EXT_CMD(str_umount, umount);
-GUESTFSD_EXT_CMD(str_btrfsimage, btrfs-image);
-
COMPILE_REGEXP (re_btrfs_subvolume_list,
"ID\...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...blockdev,
+ "blockdev",
switc,
NULL,
NULL,
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 5f1e5d1d0..c7f08fb46 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -33,12 +33,8 @@
#include "c-ctype.h"
#include "ignore-value.h"
-GUESTFSD_EXT_CMD(str_btrfs, btrfs);
-GUESTFSD_EXT_CMD(str_btrfstune, btrfstune);
-GUESTFSD_EXT_CMD(str_btrfsck, btrfsck);
-GUESTFSD_EXT_CMD(str_mkfs_btrfs, mkfs.btrfs);
-GUESTFSD_EXT_CMD(str_umount, umount);
-GUESTFSD_EXT_CMD(str_btrfsimage, btrfs-image);
+DECLARE_EXTERNAL_COMMANDS ("btrfs", "btrfstune",...
2014 Dec 26
10
[PATCH 0/5] btrfs: add API for btrfs filesystem, check and scrub
Hi,
There is one problem: btrfs_filesystem_set_label just doesnt work,
giving error message:
libguestfs: error: btrfs_filesystem_set_label: /: ERROR: unable to set label Bad address
I'm almost sure the patch has no problem, but can't figure out what's
the cause. So patch 5 is only for review.
Other APIs have no problem.
Regards,
Hu
Hu Tao (5):
New API: btrfs_scrub
New API:
2015 Jan 16
18
[PATCH 00/16] btrfs: add support to btrfs scrub, balance, rescue and inspect
Hi,
This series adds new APIs to support btrfs scrub, 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
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:
2015 Jul 08
0
[PATCH 1/5] labels: move btrfslabel to btrfs.c
.../btrfs.c
index 8fcfd81..ee3464d 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -70,6 +70,22 @@ btrfs_get_label (const char *device)
return out;
}
+int
+btrfs_set_label (const char *device, const char *label)
+{
+ int r;
+ CLEANUP_FREE char *err = NULL;
+
+ r = command (NULL, &err, str_btrfs, "filesystem", "label",
+ device, label, NULL);
+ if (r == -1) {
+ reply_with_error ("%s", err);
+ return -1;
+ }
+
+ return 0;
+}
+
/* Takes optional arguments, consult optargs_bitmask. */
int
do_btrfs_filesystem_resize (const char *filesyste...
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):
2015 Jan 14
2
[PATCH] daemon: use btrfs(1) to get btrfs labels
..._get_label (mountable->device);
+
return get_blkid_tag (mountable->device, "LABEL");
}
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 150c089..cf1507d 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -44,6 +44,30 @@ optgroup_btrfs_available (void)
return prog_exists (str_btrfs) && filesystem_available ("btrfs") > 0;
}
+char *
+btrfs_get_label (const char *device)
+{
+ int r;
+ CLEANUP_FREE char *err = NULL;
+ char *out = NULL;
+ size_t len;
+
+ r = command (&out, &err, str_btrfs, "filesystem", "label",
+...
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 05
2
Re: [PATCH 1/8] New API: btrfs_subvolume_get_default
On Tue, Dec 02, 2014 at 05:33:31PM +0800, Hu Tao wrote:
> + ADD_ARG (argv, i, str_btrfs);
> + ADD_ARG (argv, i, "subvolume");
> + ADD_ARG (argv, i, "get-default");
> + ADD_ARG (argv, i, fs_buf);
> + ADD_ARG (argv, i, NULL);
> +
> + r = commandv (&out, &err, argv);
> + if (r == -1) {
> + reply_with_error ("%s: %s",...
2015 Jan 05
3
Re: [PATCH 5/5] New API: btrfs_filesystem_set_label
...h_buf = NULL;
> + CLEANUP_FREE char *err = NULL;
> + CLEANUP_FREE char *out = NULL;
> + int r;
> +
> + path_buf = sysroot_path (path);
> + if (path_buf == NULL) {
> + reply_with_perror ("malloc");
> + return -1;
> + }
> +
> + ADD_ARG (argv, i, str_btrfs);
> + ADD_ARG (argv, i, "filesystem");
> + ADD_ARG (argv, i, "label");
> + ADD_ARG (argv, i, path_buf);
> + ADD_ARG (argv, i, label);
> + ADD_ARG (argv, i, NULL);
> +
> + r = commandv (&out, &err, argv);
> + if (r == -1) {
> + reply_w...
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:
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.
2015 Oct 27
1
[PATCHv3] Added btrfs support to vfs_minimum_size.
...nd.
+ */
+static int
+test_btrfs_min_dev_size (void)
+{
+ CLEANUP_FREE char *err = NULL, *out = NULL;
+ static int result = -1;
+ const char *cmd_pattern = "btrfs inspect-internal min-dev-size";
+ int r;
+
+ if (result != -1)
+ return result;
+
+ r = commandr (&out, &err, str_btrfs, "--help", NULL);
+
+ if (r == -1) {
+ reply_with_error ("btrfs: %s", err);
+ return -1;
+ }
+
+ if (strstr (out, cmd_pattern) == NULL)
+ result = 0;
+ else
+ result = 1;
+
+ return result;
+}
+
+int64_t
+btrfs_minimum_size (const char *path)
+{
+ CLEANUP_FREE...
2013 Jan 24
5
[PATCH] btrfs: Fix btrfs_subvolume_list on F18
The output of btrfs subvolume list has changed in F18 to include generation,
which breaks the parsing in btrfs_subvolume_list. This change replaces sscanf
with a more robust regular expression. The new regular expression should also
handle the addition of future unexpected columns.
Fixes RHBZ#903620
---
daemon/Makefile.am | 6 +++--
daemon/btrfs.c | 67
2015 Jan 07
2
Re: [PATCH 2/5] New API: btrfs_check
...n 0;
> }
> +
> +int
> +do_btrfs_check (const char *device)
> +{
> + const size_t MAX_ARGS = 64;
> + const char *argv[MAX_ARGS];
> + size_t i = 0;
> + CLEANUP_FREE char *err = NULL;
> + CLEANUP_FREE char *out = NULL;
> + int r;
> +
> + ADD_ARG (argv, i, str_btrfs);
> + ADD_ARG (argv, i, "check");
> + ADD_ARG (argv, i, device);
> + ADD_ARG (argv, i, NULL);
> +
> + r = commandv (&out, &err, argv);
> + if (r == -1) {
> + reply_with_error ("%s: %s", device, err);
> + return -1;
> + }
> +
>...
2015 Feb 21
5
[PATCH v2 0/4] btrfs: add support to btrfs inspect-internal
This series adds new APIs to support btrfs inspect-internal.
v2:
- use full name of btrfs command as inspect-internal
Hu Tao (4):
New API: btrfs_inspect_internal_rootid
New API: btrfs_inspect_internal_subvolid_resolve
New API: btrfs_inspect_internal_inode_resolve
New API: btrfs_inspect_internal_logical_resolve
daemon/btrfs.c | 161
2017 Jul 24
6
[PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
Replace GUESTFSD_EXT_CMD with a command line option
‘./guestfsd --print-external-commands’
2015 Jan 07
2
Re: [PATCH 1/5] New API: btrfs_scrub
...h_buf = NULL;
> + CLEANUP_FREE char *err = NULL;
> + CLEANUP_FREE char *out = NULL;
> + int r;
> +
> + path_buf = sysroot_path (path);
> + if (path_buf == NULL) {
> + reply_with_perror ("malloc");
> + return -1;
> + }
> +
> + ADD_ARG (argv, i, str_btrfs);
> + ADD_ARG (argv, i, "scrub");
> + ADD_ARG (argv, i, "start");
> + ADD_ARG (argv, i, path_buf);
> + ADD_ARG (argv, i, NULL);
> +
> + r = commandv (&out, &err, argv);
> + if (r == -1) {
> + reply_with_error ("%s: %s", path, er...