Configure script tests for Perl modules.
[libguestfs.git] / src / generator.ml
index 7ea2806..d9fe30a 100755 (executable)
@@ -284,6 +284,32 @@ The first character of C<param> string must be a C<-> (dash).
 
 C<value> can be NULL.");
 
+  ("set_qemu", (RErr, [String "qemu"]), -1, [FishAlias "qemu"],
+   [],
+   "set the qemu binary",
+   "\
+Set the qemu binary that we will use.
+
+The default is chosen when the library was compiled by the
+configure script.
+
+You can also override this by setting the C<LIBGUESTFS_QEMU>
+environment variable.
+
+The string C<qemu> is stashed in the libguestfs handle, so the caller
+must make sure it remains valid for the lifetime of the handle.
+
+Setting C<qemu> to C<NULL> restores the default qemu binary.");
+
+  ("get_qemu", (RConstString "qemu", []), -1, [],
+   [],
+   "get the qemu binary",
+   "\
+Return the current qemu binary.
+
+This is always non-NULL.  If it wasn't set already, then this will
+return the default qemu binary name.");
+
   ("set_path", (RErr, [String "path"]), -1, [FishAlias "path"],
    [],
    "set the search path",
@@ -1409,6 +1435,37 @@ it to local file C<tarball>.
 
 To download an uncompressed tarball, use C<guestfs_tar_out>.");
 
+  ("mount_ro", (RErr, [String "device"; String "mountpoint"]), 73, [],
+   [InitBasicFS, TestLastFail (
+      [["umount"; "/"];
+       ["mount_ro"; "/dev/sda1"; "/"];
+       ["touch"; "/new"]]);
+    InitBasicFS, TestOutput (
+      [["write_file"; "/new"; "data"; "0"];
+       ["umount"; "/"];
+       ["mount_ro"; "/dev/sda1"; "/"];
+       ["cat"; "/new"]], "data")],
+   "mount a guest disk, read-only",
+   "\
+This is the same as the C<guestfs_mount> command, but it
+mounts the filesystem with the read-only (I<-o ro>) flag.");
+
+  ("mount_options", (RErr, [String "options"; String "device"; String "mountpoint"]), 74, [],
+   [],
+   "mount a guest disk with mount options",
+   "\
+This is the same as the C<guestfs_mount> command, but it
+allows you to set the mount options as for the
+L<mount(8)> I<-o> flag.");
+
+  ("mount_vfs", (RErr, [String "options"; String "vfstype"; String "device"; String "mountpoint"]), 75, [],
+   [],
+   "mount a guest disk with mount options and vfstype",
+   "\
+This is the same as the C<guestfs_mount> command, but it
+allows you to set both the mount options and the vfstype
+as for the L<mount(8)> I<-o> and I<-t> flags.");
+
 ]
 
 let all_functions = non_daemon_functions @ daemon_functions
@@ -3770,7 +3827,7 @@ and generate_fish_actions_pod () =
        function
        | String n -> pr " %s" n
        | OptString n -> pr " %s" n
-       | StringList n -> pr " %s,..." n
+       | StringList n -> pr " '%s ...'" n
        | Bool _ -> pr " true|false"
        | Int n -> pr " %s" n
        | FileIn n | FileOut n -> pr " (%s|-)" n
@@ -4080,6 +4137,8 @@ copy_table (char * const * argv)
       pr "{\n";
 
       (match params with
+       | [p1; p2; p3; p4; p5] ->
+          pr "  CAMLparam5 (%s);\n" (String.concat ", " params)
        | p1 :: p2 :: p3 :: p4 :: p5 :: rest ->
           pr "  CAMLparam5 (%s);\n" (String.concat ", " [p1; p2; p3; p4; p5]);
           pr "  CAMLxparam%d (%s);\n"
@@ -5710,14 +5769,14 @@ Java_com_redhat_et_libguestfs_GuestFS__1create
     return 0;
   }
   guestfs_set_error_handler (g, NULL, NULL);
-  return (jlong) g;
+  return (jlong) (long) g;
 }
 
 JNIEXPORT void JNICALL
 Java_com_redhat_et_libguestfs_GuestFS__1close
   (JNIEnv *env, jobject obj, jlong jg)
 {
-  guestfs_h *g = (guestfs_h *) jg;
+  guestfs_h *g = (guestfs_h *) (long) jg;
   guestfs_close (g);
 }
 
@@ -5738,7 +5797,7 @@ Java_com_redhat_et_libguestfs_GuestFS__1close
           pr "jobjectArray ";
       );
       pr "JNICALL\n";
-      pr "Java_com_redhat_et_libguestfs_";
+      pr "Java_com_redhat_et_libguestfs_GuestFS_";
       pr "%s" (replace_str ("_" ^ name) "_" "_1");
       pr "\n";
       pr "  (JNIEnv *env, jobject obj, jlong jg";
@@ -5758,7 +5817,7 @@ Java_com_redhat_et_libguestfs_GuestFS__1close
       ) (snd style);
       pr ")\n";
       pr "{\n";
-      pr "  guestfs_h *g = (guestfs_h *) jg;\n";
+      pr "  guestfs_h *g = (guestfs_h *) (long) jg;\n";
       let error_code, no_ret =
        match fst style with
        | RErr -> pr "  int r;\n"; "-1", ""