generator: Group and move APIs from actions.ml into actions_*.ml.

Group the APIs logically and move them into new modules:

Actions_core:
  Core APIs and anything that doesn't fit into another group, eg. launch.
  (With some more effort this could be split further.)

Actions_augeas:
  Augeas APIs, eg. aug-init.

Actions_debug:
  Debug APIs.

Actions_hivex:
  Hivex APIs, eg. hivex-open.

Actions_inspection:
  Inspection APIs, eg. inspect-get-type.

Actions_properties:
  Handle properties, eg. set-hv, get-hv.

Actions_tsk:
  SleuthKit APIs, eg. filesystem-walk.

*_deprecated:
  All of the above modules have deprecated variants, where we
  place the deprecated actions.
This commit is contained in:
Richard W.M. Jones
2017-02-18 10:32:33 +00:00
parent 736ee3586f
commit 97773d2bbe
24 changed files with 13681 additions and 13138 deletions

View File

@@ -0,0 +1,793 @@
(* libguestfs
* Copyright (C) 2009-2017 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*)
(* Please read generator/README first. *)
open Utils
open Types
(* "Core" APIs. All the APIs in this file are deprecated. *)
let non_daemon_functions = [
{ defaults with
name = "wait_ready"; added = (0, 0, 3);
style = RErr, [], [];
visibility = VStateTest;
deprecated_by = Some "launch";
blocking = false;
shortdesc = "wait until the hypervisor launches (no op)";
longdesc = "\
This function is a no op.
In versions of the API E<lt> 1.0.71 you had to call this function
just after calling C<guestfs_launch> to wait for the launch
to complete. However this is no longer necessary because
C<guestfs_launch> now does the waiting.
If you see any calls to this function in code then you can just
remove them, unless you want to retain compatibility with older
versions of the API." };
{ defaults with
name = "kill_subprocess"; added = (0, 0, 3);
style = RErr, [], [];
deprecated_by = Some "shutdown";
shortdesc = "kill the hypervisor";
longdesc = "\
This kills the hypervisor.
Do not call this. See: C<guestfs_shutdown> instead." };
{ defaults with
name = "add_cdrom"; added = (0, 0, 3);
style = RErr, [String "filename"], [];
deprecated_by = Some "add_drive_ro"; config_only = true;
blocking = false;
shortdesc = "add a CD-ROM disk image to examine";
longdesc = "\
This function adds a virtual CD-ROM disk image to the guest.
The image is added as read-only drive, so this function is equivalent
of C<guestfs_add_drive_ro>." };
{ defaults with
name = "add_drive_with_if"; added = (1, 0, 84);
style = RErr, [String "filename"; String "iface"], [];
deprecated_by = Some "add_drive"; config_only = true;
blocking = false;
shortdesc = "add a drive specifying the QEMU block emulation to use";
longdesc = "\
This is the same as C<guestfs_add_drive> but it allows you
to specify the QEMU interface emulation to use at run time." };
{ defaults with
name = "add_drive_ro_with_if"; added = (1, 0, 84);
style = RErr, [String "filename"; String "iface"], [];
blocking = false;
deprecated_by = Some "add_drive"; config_only = true;
shortdesc = "add a drive read-only specifying the QEMU block emulation to use";
longdesc = "\
This is the same as C<guestfs_add_drive_ro> but it allows you
to specify the QEMU interface emulation to use at run time." };
{ defaults with
name = "lstatlist"; added = (1, 0, 77);
style = RStructList ("statbufs", "stat"), [Pathname "path"; FilenameList "names"], [];
deprecated_by = Some "lstatnslist";
shortdesc = "lstat on multiple files";
longdesc = "\
This call allows you to perform the C<guestfs_lstat> operation
on multiple files, where all files are in the directory C<path>.
C<names> is the list of files from this directory.
On return you get a list of stat structs, with a one-to-one
correspondence to the C<names> list. If any name did not exist
or could not be lstat'd, then the C<st_ino> field of that structure
is set to C<-1>.
This call is intended for programs that want to efficiently
list a directory contents without making many round-trips.
See also C<guestfs_lxattrlist> for a similarly efficient call
for getting extended attributes." };
]
let daemon_functions = [
{ defaults with
name = "sfdisk"; added = (0, 0, 8);
style = RErr, [Device "device";
Int "cyls"; Int "heads"; Int "sectors";
StringList "lines"], [];
proc_nr = Some 43;
deprecated_by = Some "part_add";
shortdesc = "create partitions on a block device";
longdesc = "\
This is a direct interface to the L<sfdisk(8)> program for creating
partitions on block devices.
C<device> should be a block device, for example F</dev/sda>.
C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads
and sectors on the device, which are passed directly to sfdisk as
the I<-C>, I<-H> and I<-S> parameters. If you pass C<0> for any
of these, then the corresponding parameter is omitted. Usually for
'large' disks, you can just pass C<0> for these, but for small
(floppy-sized) disks, sfdisk (or rather, the kernel) cannot work
out the right geometry and you will need to tell it.
C<lines> is a list of lines that we feed to C<sfdisk>. For more
information refer to the L<sfdisk(8)> manpage.
To create a single partition occupying the whole disk, you would
pass C<lines> as a single element list, when the single element being
the string C<,> (comma).
See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>,
C<guestfs_part_init>" };
{ defaults with
name = "blockdev_setbsz"; added = (1, 9, 3);
style = RErr, [Device "device"; Int "blocksize"], [];
proc_nr = Some 61;
deprecated_by = Some "mkfs";
shortdesc = "set blocksize of block device";
longdesc = "\
This call does nothing and has never done anything
because of a bug in blockdev. B<Do not use it.>
If you need to set the filesystem block size, use the
C<blocksize> option of C<guestfs_mkfs>." };
{ defaults with
name = "tgz_in"; added = (1, 0, 3);
style = RErr, [FileIn "tarball"; Pathname "directory"], [];
proc_nr = Some 71;
deprecated_by = Some "tar_in";
cancellable = true;
tests = [
InitScratchFS, Always, TestResultString (
[["mkdir"; "/tgz_in"];
["tgz_in"; "$srcdir/../../test-data/files/helloworld.tar.gz"; "/tgz_in"];
["cat"; "/tgz_in/hello"]], "hello\n"), []
];
shortdesc = "unpack compressed tarball to directory";
longdesc = "\
This command uploads and unpacks local file C<tarball> (a
I<gzip compressed> tar file) into F<directory>." };
{ defaults with
name = "tgz_out"; added = (1, 0, 3);
style = RErr, [Pathname "directory"; FileOut "tarball"], [];
proc_nr = Some 72;
deprecated_by = Some "tar_out";
cancellable = true;
shortdesc = "pack directory into compressed tarball";
longdesc = "\
This command packs the contents of F<directory> and downloads
it to local file C<tarball>." };
{ defaults with
name = "set_e2label"; added = (1, 0, 15);
style = RErr, [Device "device"; String "label"], [];
proc_nr = Some 80;
deprecated_by = Some "set_label";
tests = [
InitBasicFS, Always, TestResultString (
[["set_e2label"; "/dev/sda1"; "testlabel"];
["get_e2label"; "/dev/sda1"]], "testlabel"), []
];
shortdesc = "set the ext2/3/4 filesystem label";
longdesc = "\
This sets the ext2/3/4 filesystem label of the filesystem on
C<device> to C<label>. Filesystem labels are limited to
16 characters.
You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label>
to return the existing label on a filesystem." };
{ defaults with
name = "get_e2label"; added = (1, 0, 15);
style = RString "label", [Device "device"], [];
proc_nr = Some 81;
deprecated_by = Some "vfs_label";
shortdesc = "get the ext2/3/4 filesystem label";
longdesc = "\
This returns the ext2/3/4 filesystem label of the filesystem on
C<device>." };
{ defaults with
name = "set_e2uuid"; added = (1, 0, 15);
style = RErr, [Device "device"; String "uuid"], [];
proc_nr = Some 82;
deprecated_by = Some "set_uuid";
tests = [
InitBasicFS, Always, TestResultString (
[["set_e2uuid"; "/dev/sda1"; stable_uuid];
["get_e2uuid"; "/dev/sda1"]], stable_uuid), [];
InitBasicFS, Always, TestResultString (
[["set_e2uuid"; "/dev/sda1"; "clear"];
["get_e2uuid"; "/dev/sda1"]], ""), [];
(* We can't predict what UUIDs will be, so just check
the commands run. *)
InitBasicFS, Always, TestRun (
[["set_e2uuid"; "/dev/sda1"; "random"]]), [];
InitBasicFS, Always, TestRun (
[["set_e2uuid"; "/dev/sda1"; "time"]]), []
];
shortdesc = "set the ext2/3/4 filesystem UUID";
longdesc = "\
This sets the ext2/3/4 filesystem UUID of the filesystem on
C<device> to C<uuid>. The format of the UUID and alternatives
such as C<clear>, C<random> and C<time> are described in the
L<tune2fs(8)> manpage.
You can use C<guestfs_vfs_uuid> to return the existing UUID
of a filesystem." };
{ defaults with
name = "get_e2uuid"; added = (1, 0, 15);
style = RString "uuid", [Device "device"], [];
proc_nr = Some 83;
deprecated_by = Some "vfs_uuid";
tests = [
(* We can't predict what UUID will be, so just check
the command run; regression test for RHBZ#597112. *)
InitNone, Always, TestRun (
[["mke2journal"; "1024"; "/dev/sdc"];
["get_e2uuid"; "/dev/sdc"]]), []
];
shortdesc = "get the ext2/3/4 filesystem UUID";
longdesc = "\
This returns the ext2/3/4 filesystem UUID of the filesystem on
C<device>." };
{ defaults with
name = "sfdisk_N"; added = (1, 0, 26);
style = RErr, [Device "device"; Int "partnum";
Int "cyls"; Int "heads"; Int "sectors";
String "line"], [];
proc_nr = Some 99;
deprecated_by = Some "part_add";
shortdesc = "modify a single partition on a block device";
longdesc = "\
This runs L<sfdisk(8)> option to modify just the single
partition C<n> (note: C<n> counts from 1).
For other parameters, see C<guestfs_sfdisk>. You should usually
pass C<0> for the cyls/heads/sectors parameters.
See also: C<guestfs_part_add>" };
{ defaults with
name = "sfdisk_l"; added = (1, 0, 26);
style = RString "partitions", [Device "device"], [];
proc_nr = Some 100;
deprecated_by = Some "part_list";
shortdesc = "display the partition table";
longdesc = "\
This displays the partition table on C<device>, in the
human-readable output of the L<sfdisk(8)> command. It is
not intended to be parsed.
See also: C<guestfs_part_list>" };
{ defaults with
name = "e2fsck_f"; added = (1, 0, 29);
style = RErr, [Device "device"], [];
proc_nr = Some 108;
deprecated_by = Some "e2fsck";
shortdesc = "check an ext2/ext3 filesystem";
longdesc = "\
This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3
filesystem checker on C<device>, noninteractively (I<-p>),
even if the filesystem appears to be clean (I<-f>)." };
{ defaults with
name = "mkswap_L"; added = (1, 0, 55);
style = RErr, [String "label"; Device "device"], [];
proc_nr = Some 131;
deprecated_by = Some "mkswap";
tests = [
InitEmpty, Always, TestRun (
[["part_disk"; "/dev/sda"; "mbr"];
["mkswap_L"; "hello"; "/dev/sda1"]]), []
];
shortdesc = "create a swap partition with a label";
longdesc = "\
Create a swap partition on C<device> with label C<label>.
Note that you cannot attach a swap label to a block device
(eg. F</dev/sda>), just to a partition. This appears to be
a limitation of the kernel or swap tools." };
{ defaults with
name = "mkswap_U"; added = (1, 0, 55);
style = RErr, [String "uuid"; Device "device"], [];
proc_nr = Some 132;
deprecated_by = Some "mkswap";
optional = Some "linuxfsuuid";
tests = [
InitEmpty, Always, TestRun (
[["part_disk"; "/dev/sda"; "mbr"];
["mkswap_U"; stable_uuid; "/dev/sda1"]]), []
];
shortdesc = "create a swap partition with an explicit UUID";
longdesc = "\
Create a swap partition on C<device> with UUID C<uuid>." };
{ defaults with
name = "sfdiskM"; added = (1, 0, 55);
style = RErr, [Device "device"; StringList "lines"], [];
proc_nr = Some 139;
deprecated_by = Some "part_add";
shortdesc = "create partitions on a block device";
longdesc = "\
This is a simplified interface to the C<guestfs_sfdisk>
command, where partition sizes are specified in megabytes
only (rounded to the nearest cylinder) and you don't need
to specify the cyls, heads and sectors parameters which
were rarely if ever used anyway.
See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage
and C<guestfs_part_disk>" };
{ defaults with
name = "zfile"; added = (1, 0, 59);
style = RString "description", [String "meth"; Pathname "path"], [];
proc_nr = Some 140;
deprecated_by = Some "file";
shortdesc = "determine file type inside a compressed file";
longdesc = "\
This command runs F<file> after first decompressing C<path>
using C<method>.
C<method> must be one of C<gzip>, C<compress> or C<bzip2>.
Since 1.0.63, use C<guestfs_file> instead which can now
process compressed files." };
{ defaults with
name = "egrep"; added = (1, 0, 66);
style = RStringList "lines", [String "regex"; Pathname "path"], [];
proc_nr = Some 152;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["egrep"; "abc"; "/test-grep.txt"]],
"is_string_list (ret, 2, \"abc\", \"abc123\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<egrep> program and returns the
matching lines." };
{ defaults with
name = "fgrep"; added = (1, 0, 66);
style = RStringList "lines", [String "pattern"; Pathname "path"], [];
proc_nr = Some 153;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["fgrep"; "abc"; "/test-grep.txt"]],
"is_string_list (ret, 2, \"abc\", \"abc123\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<fgrep> program and returns the
matching lines." };
{ defaults with
name = "grepi"; added = (1, 0, 66);
style = RStringList "lines", [String "regex"; Pathname "path"], [];
proc_nr = Some 154;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["grepi"; "abc"; "/test-grep.txt"]],
"is_string_list (ret, 3, \"abc\", \"abc123\", \"ABC\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<grep -i> program and returns the
matching lines." };
{ defaults with
name = "egrepi"; added = (1, 0, 66);
style = RStringList "lines", [String "regex"; Pathname "path"], [];
proc_nr = Some 155;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["egrepi"; "abc"; "/test-grep.txt"]],
"is_string_list (ret, 3, \"abc\", \"abc123\", \"ABC\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<egrep -i> program and returns the
matching lines." };
{ defaults with
name = "fgrepi"; added = (1, 0, 66);
style = RStringList "lines", [String "pattern"; Pathname "path"], [];
proc_nr = Some 156;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["fgrepi"; "abc"; "/test-grep.txt"]],
"is_string_list (ret, 3, \"abc\", \"abc123\", \"ABC\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<fgrep -i> program and returns the
matching lines." };
{ defaults with
name = "zgrep"; added = (1, 0, 66);
style = RStringList "lines", [String "regex"; Pathname "path"], [];
proc_nr = Some 157;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["zgrep"; "abc"; "/test-grep.txt.gz"]],
"is_string_list (ret, 2, \"abc\", \"abc123\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<zgrep> program and returns the
matching lines." };
{ defaults with
name = "zegrep"; added = (1, 0, 66);
style = RStringList "lines", [String "regex"; Pathname "path"], [];
proc_nr = Some 158;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["zegrep"; "abc"; "/test-grep.txt.gz"]],
"is_string_list (ret, 2, \"abc\", \"abc123\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<zegrep> program and returns the
matching lines." };
{ defaults with
name = "zfgrep"; added = (1, 0, 66);
style = RStringList "lines", [String "pattern"; Pathname "path"], [];
proc_nr = Some 159;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["zfgrep"; "abc"; "/test-grep.txt.gz"]],
"is_string_list (ret, 2, \"abc\", \"abc123\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<zfgrep> program and returns the
matching lines." };
{ defaults with
name = "zgrepi"; added = (1, 0, 66);
style = RStringList "lines", [String "regex"; Pathname "path"], [];
proc_nr = Some 160;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["zgrepi"; "abc"; "/test-grep.txt.gz"]],
"is_string_list (ret, 3, \"abc\", \"abc123\", \"ABC\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<zgrep -i> program and returns the
matching lines." };
{ defaults with
name = "zegrepi"; added = (1, 0, 66);
style = RStringList "lines", [String "regex"; Pathname "path"], [];
proc_nr = Some 161;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["zegrepi"; "abc"; "/test-grep.txt.gz"]],
"is_string_list (ret, 3, \"abc\", \"abc123\", \"ABC\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<zegrep -i> program and returns the
matching lines." };
{ defaults with
name = "zfgrepi"; added = (1, 0, 66);
style = RStringList "lines", [String "pattern"; Pathname "path"], [];
proc_nr = Some 162;
protocol_limit_warning = true;
deprecated_by = Some "grep";
tests = [
InitISOFS, Always, TestResult (
[["zfgrepi"; "abc"; "/test-grep.txt.gz"]],
"is_string_list (ret, 3, \"abc\", \"abc123\", \"ABC\")"), []
];
shortdesc = "return lines matching a pattern";
longdesc = "\
This calls the external C<zfgrep -i> program and returns the
matching lines." };
{ defaults with
name = "fallocate"; added = (1, 0, 66);
style = RErr, [Pathname "path"; Int "len"], [];
proc_nr = Some 169;
deprecated_by = Some "fallocate64";
tests = [
InitScratchFS, Always, TestResult (
[["fallocate"; "/fallocate"; "1000000"];
["stat"; "/fallocate"]], "ret->size == 1000000"), []
];
shortdesc = "preallocate a file in the guest filesystem";
longdesc = "\
This command preallocates a file (containing zero bytes) named
C<path> of size C<len> bytes. If the file exists already, it
is overwritten.
Do not confuse this with the guestfish-specific
C<alloc> command which allocates a file in the host and
attaches it as a device." };
{ defaults with
name = "setcon"; added = (1, 0, 67);
style = RErr, [String "context"], [];
proc_nr = Some 185;
optional = Some "selinux";
deprecated_by = Some "selinux_relabel";
shortdesc = "set SELinux security context";
longdesc = "\
This sets the SELinux security context of the daemon
to the string C<context>.
See the documentation about SELINUX in L<guestfs(3)>." };
{ defaults with
name = "getcon"; added = (1, 0, 67);
style = RString "context", [], [];
proc_nr = Some 186;
optional = Some "selinux";
deprecated_by = Some "selinux_relabel";
shortdesc = "get SELinux security context";
longdesc = "\
This gets the SELinux security context of the daemon.
See the documentation about SELINUX in L<guestfs(3)>,
and C<guestfs_setcon>" };
{ defaults with
name = "mkfs_b"; added = (1, 0, 68);
style = RErr, [String "fstype"; Int "blocksize"; Device "device"], [];
proc_nr = Some 187;
deprecated_by = Some "mkfs";
tests = [
InitEmpty, Always, TestResultString (
[["part_disk"; "/dev/sda"; "mbr"];
["mkfs_b"; "ext2"; "4096"; "/dev/sda1"];
["mount"; "/dev/sda1"; "/"];
["write"; "/new"; "new file contents"];
["cat"; "/new"]], "new file contents"), [];
InitEmpty, Always, TestRun (
[["part_init"; "/dev/sda"; "mbr"];
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["mkfs_b"; "vfat"; "32768"; "/dev/sda1"]]), [];
InitEmpty, Always, TestLastFail (
[["part_init"; "/dev/sda"; "mbr"];
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["mkfs_b"; "vfat"; "32769"; "/dev/sda1"]]), [];
InitEmpty, Always, TestLastFail (
[["part_init"; "/dev/sda"; "mbr"];
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["mkfs_b"; "vfat"; "33280"; "/dev/sda1"]]), [];
InitEmpty, IfAvailable "ntfsprogs", TestRun (
[["part_disk"; "/dev/sda"; "mbr"];
["mkfs_b"; "ntfs"; "32768"; "/dev/sda1"]]), []
];
shortdesc = "make a filesystem with block size";
longdesc = "\
This call is similar to C<guestfs_mkfs>, but it allows you to
control the block size of the resulting filesystem. Supported
block sizes depend on the filesystem type, but typically they
are C<1024>, C<2048> or C<4096> only.
For VFAT and NTFS the C<blocksize> parameter is treated as
the requested cluster size." };
{ defaults with
name = "mke2journal"; added = (1, 0, 68);
style = RErr, [Int "blocksize"; Device "device"], [];
proc_nr = Some 188;
deprecated_by = Some "mke2fs";
tests = [
InitEmpty, Always, TestResultString (
[["part_init"; "/dev/sda"; "mbr"];
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["part_add"; "/dev/sda"; "p"; "204800"; "-64"];
["mke2journal"; "4096"; "/dev/sda1"];
["mke2fs_J"; "ext2"; "4096"; "/dev/sda2"; "/dev/sda1"];
["mount"; "/dev/sda2"; "/"];
["write"; "/new"; "new file contents"];
["cat"; "/new"]], "new file contents"), []
];
shortdesc = "make ext2/3/4 external journal";
longdesc = "\
This creates an ext2 external journal on C<device>. It is equivalent
to the command:
mke2fs -O journal_dev -b blocksize device" };
{ defaults with
name = "mke2journal_L"; added = (1, 0, 68);
style = RErr, [Int "blocksize"; String "label"; Device "device"], [];
proc_nr = Some 189;
deprecated_by = Some "mke2fs";
tests = [
InitEmpty, Always, TestResultString (
[["part_init"; "/dev/sda"; "mbr"];
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["part_add"; "/dev/sda"; "p"; "204800"; "-64"];
["mke2journal_L"; "4096"; "JOURNAL"; "/dev/sda1"];
["mke2fs_JL"; "ext2"; "4096"; "/dev/sda2"; "JOURNAL"];
["mount"; "/dev/sda2"; "/"];
["write"; "/new"; "new file contents"];
["cat"; "/new"]], "new file contents"), []
];
shortdesc = "make ext2/3/4 external journal with label";
longdesc = "\
This creates an ext2 external journal on C<device> with label C<label>." };
{ defaults with
name = "mke2journal_U"; added = (1, 0, 68);
style = RErr, [Int "blocksize"; String "uuid"; Device "device"], [];
proc_nr = Some 190;
deprecated_by = Some "mke2fs";
optional = Some "linuxfsuuid";
tests = [
InitEmpty, Always, TestResultString (
[["part_init"; "/dev/sda"; "mbr"];
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["part_add"; "/dev/sda"; "p"; "204800"; "-64"];
["mke2journal_U"; "4096"; stable_uuid; "/dev/sda1"];
["mke2fs_JU"; "ext2"; "4096"; "/dev/sda2"; stable_uuid];
["mount"; "/dev/sda2"; "/"];
["write"; "/new"; "new file contents"];
["cat"; "/new"]], "new file contents"), []
];
shortdesc = "make ext2/3/4 external journal with UUID";
longdesc = "\
This creates an ext2 external journal on C<device> with UUID C<uuid>." };
{ defaults with
name = "mke2fs_J"; added = (1, 0, 68);
style = RErr, [String "fstype"; Int "blocksize"; Device "device"; Device "journal"], [];
proc_nr = Some 191;
deprecated_by = Some "mke2fs";
shortdesc = "make ext2/3/4 filesystem with external journal";
longdesc = "\
This creates an ext2/3/4 filesystem on C<device> with
an external journal on C<journal>. It is equivalent
to the command:
mke2fs -t fstype -b blocksize -J device=<journal> <device>
See also C<guestfs_mke2journal>." };
{ defaults with
name = "mke2fs_JL"; added = (1, 0, 68);
style = RErr, [String "fstype"; Int "blocksize"; Device "device"; String "label"], [];
proc_nr = Some 192;
deprecated_by = Some "mke2fs";
shortdesc = "make ext2/3/4 filesystem with external journal";
longdesc = "\
This creates an ext2/3/4 filesystem on C<device> with
an external journal on the journal labeled C<label>.
See also C<guestfs_mke2journal_L>." };
{ defaults with
name = "mke2fs_JU"; added = (1, 0, 68);
style = RErr, [String "fstype"; Int "blocksize"; Device "device"; String "uuid"], [];
proc_nr = Some 193;
deprecated_by = Some "mke2fs";
optional = Some "linuxfsuuid";
shortdesc = "make ext2/3/4 filesystem with external journal";
longdesc = "\
This creates an ext2/3/4 filesystem on C<device> with
an external journal on the journal with UUID C<uuid>.
See also C<guestfs_mke2journal_U>." };
{ defaults with
name = "dd"; added = (1, 0, 80);
style = RErr, [Dev_or_Path "src"; Dev_or_Path "dest"], [];
proc_nr = Some 217;
deprecated_by = Some "copy_device_to_device";
tests = [
InitScratchFS, Always, TestResult (
[["mkdir"; "/dd"];
["write"; "/dd/src"; "hello, world"];
["dd"; "/dd/src"; "/dd/dest"];
["read_file"; "/dd/dest"]],
"compare_buffers (ret, size, \"hello, world\", 12) == 0"), []
];
shortdesc = "copy from source to destination using dd";
longdesc = "\
This command copies from one source device or file C<src>
to another destination device or file C<dest>. Normally you
would use this to copy to or from a device or partition, for
example to duplicate a filesystem.
If the destination is a device, it must be as large or larger
than the source file or device, otherwise the copy will fail.
This command cannot do partial copies
(see C<guestfs_copy_device_to_device>)." };
{ defaults with
name = "txz_in"; added = (1, 3, 2);
style = RErr, [FileIn "tarball"; Pathname "directory"], [];
proc_nr = Some 229;
deprecated_by = Some "tar_in";
optional = Some "xz"; cancellable = true;
tests = [
InitScratchFS, Always, TestResultString (
[["mkdir"; "/txz_in"];
["txz_in"; "$srcdir/../../test-data/files/helloworld.tar.xz"; "/txz_in"];
["cat"; "/txz_in/hello"]], "hello\n"), []
];
shortdesc = "unpack compressed tarball to directory";
longdesc = "\
This command uploads and unpacks local file C<tarball> (an
I<xz compressed> tar file) into F<directory>." };
{ defaults with
name = "txz_out"; added = (1, 3, 2);
style = RErr, [Pathname "directory"; FileOut "tarball"], [];
proc_nr = Some 230;
deprecated_by = Some "tar_out";
optional = Some "xz"; cancellable = true;
shortdesc = "pack directory into compressed tarball";
longdesc = "\
This command packs the contents of F<directory> and downloads
it to local file C<tarball> (as an xz compressed tar archive)." };
{ defaults with
name = "llz"; added = (1, 17, 6);
style = RString "listing", [Pathname "directory"], [];
proc_nr = Some 305;
deprecated_by = Some "lgetxattrs";
shortdesc = "list the files in a directory (long format with SELinux contexts)";
longdesc = "\
List the files in F<directory> in the format of 'ls -laZ'.
This command is mostly useful for interactive sessions. It
is I<not> intended that you try to parse the output string." };
]