}
CAMLprim value
+ocaml_guestfs_set_qemu (value gv, value qemuv)
+{
+ CAMLparam2 (gv, qemuv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("set_qemu: used handle after closing it");
+
+ const char *qemu = String_val (qemuv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_set_qemu (g, qemu);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "set_qemu");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_get_qemu (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("get_qemu: used handle after closing it");
+
+ const char *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_get_qemu (g);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "get_qemu");
+
+ rv = caml_copy_string (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
ocaml_guestfs_set_path (value gv, value pathv)
{
CAMLparam2 (gv, pathv);
}
CAMLprim value
+ocaml_guestfs_is_ready (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("is_ready: used handle after closing it");
+
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_is_ready (g);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "is_ready");
+
+ rv = Val_bool (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_is_config (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("is_config: used handle after closing it");
+
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_is_config (g);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "is_config");
+
+ rv = Val_bool (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_is_launching (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("is_launching: used handle after closing it");
+
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_is_launching (g);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "is_launching");
+
+ rv = Val_bool (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_is_busy (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("is_busy: used handle after closing it");
+
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_is_busy (g);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "is_busy");
+
+ rv = Val_bool (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_get_state (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("get_state: used handle after closing it");
+
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_get_state (g);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "get_state");
+
+ rv = Val_int (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_set_busy (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("set_busy: used handle after closing it");
+
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_set_busy (g);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "set_busy");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_set_ready (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("set_ready: used handle after closing it");
+
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_set_ready (g);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "set_ready");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
ocaml_guestfs_mount (value gv, value devicev, value mountpointv)
{
CAMLparam3 (gv, devicev, mountpointv);
CAMLreturn (rv);
}
+CAMLprim value
+ocaml_guestfs_upload (value gv, value filenamev, value remotefilenamev)
+{
+ CAMLparam3 (gv, filenamev, remotefilenamev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("upload: used handle after closing it");
+
+ const char *filename = String_val (filenamev);
+ const char *remotefilename = String_val (remotefilenamev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_upload (g, filename, remotefilename);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "upload");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_download (value gv, value remotefilenamev, value filenamev)
+{
+ CAMLparam3 (gv, remotefilenamev, filenamev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("download: used handle after closing it");
+
+ const char *remotefilename = String_val (remotefilenamev);
+ const char *filename = String_val (filenamev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_download (g, remotefilename, filename);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "download");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_checksum (value gv, value csumtypev, value pathv)
+{
+ CAMLparam3 (gv, csumtypev, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("checksum: used handle after closing it");
+
+ const char *csumtype = String_val (csumtypev);
+ const char *path = String_val (pathv);
+ char *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_checksum (g, csumtype, path);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "checksum");
+
+ rv = caml_copy_string (r);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_tar_in (value gv, value tarfilev, value directoryv)
+{
+ CAMLparam3 (gv, tarfilev, directoryv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("tar_in: used handle after closing it");
+
+ const char *tarfile = String_val (tarfilev);
+ const char *directory = String_val (directoryv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_tar_in (g, tarfile, directory);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "tar_in");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_tar_out (value gv, value directoryv, value tarfilev)
+{
+ CAMLparam3 (gv, directoryv, tarfilev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("tar_out: used handle after closing it");
+
+ const char *directory = String_val (directoryv);
+ const char *tarfile = String_val (tarfilev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_tar_out (g, directory, tarfile);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "tar_out");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_tgz_in (value gv, value tarballv, value directoryv)
+{
+ CAMLparam3 (gv, tarballv, directoryv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("tgz_in: used handle after closing it");
+
+ const char *tarball = String_val (tarballv);
+ const char *directory = String_val (directoryv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_tgz_in (g, tarball, directory);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "tgz_in");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_tgz_out (value gv, value directoryv, value tarballv)
+{
+ CAMLparam3 (gv, directoryv, tarballv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("tgz_out: used handle after closing it");
+
+ const char *directory = String_val (directoryv);
+ const char *tarball = String_val (tarballv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_tgz_out (g, directory, tarball);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "tgz_out");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_mount_ro (value gv, value devicev, value mountpointv)
+{
+ CAMLparam3 (gv, devicev, mountpointv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("mount_ro: used handle after closing it");
+
+ const char *device = String_val (devicev);
+ const char *mountpoint = String_val (mountpointv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_mount_ro (g, device, mountpoint);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "mount_ro");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_mount_options (value gv, value optionsv, value devicev, value mountpointv)
+{
+ CAMLparam4 (gv, optionsv, devicev, mountpointv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("mount_options: used handle after closing it");
+
+ const char *options = String_val (optionsv);
+ const char *device = String_val (devicev);
+ const char *mountpoint = String_val (mountpointv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_mount_options (g, options, device, mountpoint);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "mount_options");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_mount_vfs (value gv, value optionsv, value vfstypev, value devicev, value mountpointv)
+{
+ CAMLparam5 (gv, optionsv, vfstypev, devicev, mountpointv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("mount_vfs: used handle after closing it");
+
+ const char *options = String_val (optionsv);
+ const char *vfstype = String_val (vfstypev);
+ const char *device = String_val (devicev);
+ const char *mountpoint = String_val (mountpointv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "mount_vfs");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_debug (value gv, value subcmdv, value extraargsv)
+{
+ CAMLparam3 (gv, subcmdv, extraargsv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("debug: used handle after closing it");
+
+ const char *subcmd = String_val (subcmdv);
+ char **extraargs = ocaml_guestfs_strings_val (extraargsv);
+ char *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_debug (g, subcmd, extraargs);
+ caml_leave_blocking_section ();
+ ocaml_guestfs_free_strings (extraargs);
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "debug");
+
+ rv = caml_copy_string (r);
+ free (r);
+ CAMLreturn (rv);
+}
+