[Pkg-libvirt-commits] [libguestfs] 108/384: New API: btrfs_qgroup_destroy
Hilko Bengen
bengen at moszumanska.debian.org
Sun Mar 29 16:55:53 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 3617938b4803f0871c8811b42f8a0b4c1969a424
Author: Hu Tao <hutao at cn.fujitsu.com>
Date: Fri Dec 12 15:03:30 2014 +0800
New API: btrfs_qgroup_destroy
btrfs_qgroup_destroy destroys a qgroup.
Signed-off-by: Hu Tao <hutao at cn.fujitsu.com>
---
daemon/btrfs.c | 33 +++++++++++++++++++++++++++++++++
generator/actions.ml | 18 ++++++++++++++++++
src/MAX_PROC_NR | 2 +-
3 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 194c1a0..b49979e 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -1153,3 +1153,36 @@ do_btrfs_qgroup_create (const char *qgroupid, const char *subvolume)
return 0;
}
+
+int
+do_btrfs_qgroup_destroy (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");
+ ADD_ARG (argv, i, "destroy");
+ ADD_ARG (argv, i, qgroupid);
+ ADD_ARG (argv, i, subvolume_buf);
+ ADD_ARG (argv, i, NULL);
+
+ r = commandv (&out, &err, argv);
+ if (r == -1) {
+ reply_with_error ("%s: %s", subvolume, err);
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/generator/actions.ml b/generator/actions.ml
index 50a424c..9bbfdb5 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -12170,6 +12170,24 @@ can have suffix of G, M, or K. " };
longdesc = "\
Create a quota group (qgroup) for subvolume at C<subvolume>." };
+ { defaults with
+ name = "btrfs_qgroup_destroy";
+ style = RErr, [String "qgroupid"; Pathname "subvolume"], [];
+ proc_nr = Some 431;
+ optional = Some "btrfs"; camel_name = "BTRFSQgroupDestroy";
+ tests = [
+ InitPartition, Always, TestRun (
+ [["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; ""; ""];
+ ["mount"; "/dev/sda1"; "/"];
+ ["btrfs_quota_enable"; "/"; "true"];
+ ["btrfs_subvolume_create"; "/sub1"; "NOARG"];
+ ["btrfs_qgroup_create"; "0/1000"; "/sub1"];
+ ["btrfs_qgroup_destroy"; "0/1000"; "/sub1"]]), [];
+ ];
+ shortdesc = "destroy a subvolume quota group";
+ longdesc = "\
+Destroy a quota group." };
+
]
(* Non-API meta-commands available only in guestfish.
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR
index c15fb93..ed4f162 100644
--- a/src/MAX_PROC_NR
+++ b/src/MAX_PROC_NR
@@ -1 +1 @@
-430
+431
--
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