[Pkg-libvirt-commits] [libguestfs] 110/384: New API: btrfs_qgroup_assign
Hilko Bengen
bengen at moszumanska.debian.org
Sun Mar 29 16:55:54 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit bd4a114272d589335be92782bfb283d2ccad3433
Author: Hu Tao <hutao at cn.fujitsu.com>
Date: Fri Dec 12 15:03:32 2014 +0800
New API: btrfs_qgroup_assign
btrfs_qgroup_assign adds a qgroup to a parent qgroup.
Signed-off-by: Hu Tao <hutao at cn.fujitsu.com>
---
daemon/btrfs.c | 34 ++++++++++++++++++++++++++++++++++
generator/actions.ml | 19 +++++++++++++++++++
src/MAX_PROC_NR | 2 +-
3 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 88c3248..76e2806 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -1275,3 +1275,37 @@ error:
return NULL;
}
+
+int
+do_btrfs_qgroup_assign (const char *src, const char *dst, 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;
+ 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, "qgroup");
+ ADD_ARG (argv, i, "assign");
+ ADD_ARG (argv, i, src);
+ ADD_ARG (argv, i, dst);
+ 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, err);
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/generator/actions.ml b/generator/actions.ml
index 53ddbc0..1117063 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -12207,6 +12207,25 @@ Destroy a quota group." };
Show all subvolume quota groups in a btrfs filesystem, inclding their
usages." };
+ { defaults with
+ name = "btrfs_qgroup_assign";
+ style = RErr, [String "src"; String "dst"; Pathname "path"], [];
+ proc_nr = Some 433;
+ optional = Some "btrfs"; camel_name = "BTRFSQgroupAssign";
+ tests = [
+ InitPartition, Always, TestRun (
+ [["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; ""; ""];
+ ["mount"; "/dev/sda1"; "/"];
+ ["btrfs_quota_enable"; "/"; "true"];
+ ["btrfs_qgroup_create"; "0/1000"; "/"];
+ ["btrfs_qgroup_create"; "1/1000"; "/"];
+ ["btrfs_qgroup_assign"; "0/1000"; "1/1000"; "/"]]), [];
+ ];
+ shortdesc = "add a qgroup to a parent qgroup";
+ longdesc = "\
+Add qgroup C<src> to parent qgroup C<dst>. This command can group
+several qgroups into a parent qgroup to share common limit." };
+
]
(* Non-API meta-commands available only in guestfish.
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR
index 84796bf..21fbd2e 100644
--- a/src/MAX_PROC_NR
+++ b/src/MAX_PROC_NR
@@ -1 +1 @@
-432
+433
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list