Make realpath call optional, disable it for Windows.
[libguestfs.git] / src / generator.ml
index 1c533fa..9e602ac 100755 (executable)
@@ -3266,7 +3266,7 @@ matching lines.");
 This calls the external C<zfgrep -i> program and returns the
 matching lines.");
 
 This calls the external C<zfgrep -i> program and returns the
 matching lines.");
 
-  ("realpath", (RString "rpath", [Pathname "path"]), 163, [],
+  ("realpath", (RString "rpath", [Pathname "path"]), 163, [Optional "realpath"],
    [InitISOFS, Always, TestOutput (
       [["realpath"; "/../directory"]], "/directory")],
    "canonicalized absolute pathname",
    [InitISOFS, Always, TestOutput (
       [["realpath"; "/../directory"]], "/directory")],
    "canonicalized absolute pathname",
@@ -4105,28 +4105,28 @@ To fill a file with zero bytes (sparsely), it is
 much more efficient to use C<guestfs_truncate_size>.");
 
   ("available", (RErr, [StringList "groups"]), 216, [],
 much more efficient to use C<guestfs_truncate_size>.");
 
   ("available", (RErr, [StringList "groups"]), 216, [],
-   [],
+   [InitNone, Always, TestRun [["available"; ""]]],
    "test availability of some parts of the API",
    "\
 This command is used to check the availability of some
    "test availability of some parts of the API",
    "\
 This command is used to check the availability of some
-groups of libguestfs functions which not all builds of
-libguestfs will be able to provide.
+groups of functionality in the appliance, which not all builds of
+the libguestfs appliance will be able to provide.
 
 
-The precise libguestfs function groups that may be checked by this
-command are listed in L<guestfs(3)/AVAILABILITY>.
+The libguestfs groups, and the functions that those
+groups correspond to, are listed in L<guestfs(3)/AVAILABILITY>.
 
 
-The argument C<groups> is a list of API group names, eg:
+The argument C<groups> is a list of group names, eg:
 C<[\"inotify\", \"augeas\"]> would check for the availability of
 C<[\"inotify\", \"augeas\"]> would check for the availability of
-the C<guestfs_inotify_*> functions and C<guestfs_aug_*>
-(partition editing) functions.
+the Linux inotify functions and Augeas (configuration file
+editing) functions.
 
 The command returns no error if I<all> requested groups are available.
 
 
 The command returns no error if I<all> requested groups are available.
 
-It returns an error if one or more of the requested
-groups is unavailable.
+It fails with an error if one or more of the requested
+groups is unavailable in the appliance.
 
 If an unknown group name is included in the
 
 If an unknown group name is included in the
-list of C<groups> then an error is always returned.
+list of groups then an error is always returned.
 
 I<Notes:>
 
 
 I<Notes:>
 
@@ -4135,7 +4135,8 @@ I<Notes:>
 =item *
 
 You must call C<guestfs_launch> before calling this function.
 =item *
 
 You must call C<guestfs_launch> before calling this function.
-The reason is because we don't know what function groups are
+
+The reason is because we don't know what groups are
 supported by the appliance/daemon until it is running and can
 be queried.
 
 supported by the appliance/daemon until it is running and can
 be queried.
 
@@ -4162,6 +4163,22 @@ See also C<guestfs_version>.
 
 =back");
 
 
 =back");
 
+  ("dd", (RErr, [Dev_or_Path "src"; Dev_or_Path "dest"]), 217, [],
+   [InitBasicFS, Always, TestOutputBuffer (
+      [["write_file"; "/src"; "hello, world"; "0"];
+       ["dd"; "/src"; "/dest"];
+       ["read_file"; "/dest"]], "hello, world")],
+   "copy from source to destination using dd",
+   "\
+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.");
+
 ]
 
 let all_functions = non_daemon_functions @ daemon_functions
 ]
 
 let all_functions = non_daemon_functions @ daemon_functions
@@ -6628,6 +6645,8 @@ and generate_test_command_call ?(expect_error = false) ?test test_name cmd =
         | Int64 _, _
         | Bool _, _
         | FileIn _, _ | FileOut _, _ -> ()
         | Int64 _, _
         | Bool _, _
         | FileIn _, _ | FileOut _, _ -> ()
+        | StringList n, "" | DeviceList n, "" ->
+           pr "    const char *const %s[1] = { NULL };\n" n
         | StringList n, arg | DeviceList n, arg ->
             let strs = string_split " " arg in
             iteri (
         | StringList n, arg | DeviceList n, arg ->
             let strs = string_split " " arg in
             iteri (