mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
btrfs: add optional parameter `qgroupid' to btrfs_subvolume_snapshot
Parameter `qgroupid' is for adding the created snapshot to a qgroup. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
This commit is contained in:
@@ -208,7 +208,8 @@ do_mkfs_btrfs (char *const *devices,
|
||||
}
|
||||
|
||||
int
|
||||
do_btrfs_subvolume_snapshot (const char *source, const char *dest, int ro)
|
||||
do_btrfs_subvolume_snapshot (const char *source, const char *dest, int ro,
|
||||
const char *qgroupid)
|
||||
{
|
||||
const size_t MAX_ARGS = 64;
|
||||
const char *argv[MAX_ARGS];
|
||||
@@ -237,6 +238,11 @@ do_btrfs_subvolume_snapshot (const char *source, const char *dest, int ro)
|
||||
ro)
|
||||
ADD_ARG (argv, i, "-r");
|
||||
|
||||
if (optargs_bitmask & GUESTFS_BTRFS_SUBVOLUME_SNAPSHOT_QGROUPID_BITMASK) {
|
||||
ADD_ARG (argv, i, "-i");
|
||||
ADD_ARG (argv, i, qgroupid);
|
||||
}
|
||||
|
||||
ADD_ARG (argv, i, source_buf);
|
||||
ADD_ARG (argv, i, dest_buf);
|
||||
ADD_ARG (argv, i, NULL);
|
||||
|
||||
@@ -10217,7 +10217,7 @@ See C<guestfs_get_e2generation>." };
|
||||
|
||||
{ defaults with
|
||||
name = "btrfs_subvolume_snapshot";
|
||||
style = RErr, [Pathname "source"; Pathname "dest"], [OBool "ro"];
|
||||
style = RErr, [Pathname "source"; Pathname "dest"], [OBool "ro"; OString "qgroupid"];
|
||||
proc_nr = Some 322;
|
||||
once_had_no_optargs = true;
|
||||
optional = Some "btrfs"; camel_name = "BTRFSSubvolumeSnapshot";
|
||||
@@ -10229,7 +10229,8 @@ See C<guestfs_get_e2generation>." };
|
||||
["btrfs_subvolume_create"; "/test1"];
|
||||
["btrfs_subvolume_create"; "/test2"];
|
||||
["btrfs_subvolume_create"; "/dir/test3"];
|
||||
["btrfs_subvolume_snapshot"; "/dir/test3"; "/dir/test5"; "true"]]), []
|
||||
["btrfs_subvolume_snapshot"; "/dir/test3"; "/dir/test5"; "true"; "NOARG"];
|
||||
["btrfs_subvolume_snapshot"; "/dir/test3"; "/dir/test6"; ""; "0/1000"]]), []
|
||||
];
|
||||
shortdesc = "create a btrfs snapshot";
|
||||
longdesc = "\
|
||||
@@ -10237,7 +10238,9 @@ Create a snapshot of the btrfs subvolume C<source>.
|
||||
The C<dest> argument is the destination directory and the name
|
||||
of the snapshot, in the form C</path/to/dest/name>. By default
|
||||
the newly created snapshot is writable, if the value of optional
|
||||
parameter C<ro> is true, then a readonly snapshot is created." };
|
||||
parameter C<ro> is true, then a readonly snapshot is created. The
|
||||
optional parameter C<qgroupid> represents the qgroup which the
|
||||
newly created snapshot will be added to." };
|
||||
|
||||
{ defaults with
|
||||
name = "btrfs_subvolume_delete";
|
||||
|
||||
Reference in New Issue
Block a user