summaryrefslogtreecommitdiffstats
path: root/ocaml/guestfs_c_actions.c
diff options
context:
space:
mode:
authorMatthew Booth <mbooth@redhat.com>2009-06-29 16:27:05 +0100
committerMatthew Booth <mbooth@redhat.com>2009-06-29 16:27:05 +0100
commit128f822e16bb96677c75b88125e18f48d7ccedaf (patch)
treec5f09d72e73c90c02967f48151831e6c4a78fb68 /ocaml/guestfs_c_actions.c
parent103fb55e6b1428366ab31a0f17484ef1baa68e96 (diff)
parentad475104ec7fae456d3309cbf4261b893ed160bb (diff)
downloadlibguestfs-128f822e16bb96677c75b88125e18f48d7ccedaf.tar.gz
libguestfs-128f822e16bb96677c75b88125e18f48d7ccedaf.tar.xz
libguestfs-128f822e16bb96677c75b88125e18f48d7ccedaf.zip
Merge commit 'et/master'
Diffstat (limited to 'ocaml/guestfs_c_actions.c')
-rw-r--r--ocaml/guestfs_c_actions.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c
index a5e18940..8b018f6e 100644
--- a/ocaml/guestfs_c_actions.c
+++ b/ocaml/guestfs_c_actions.c
@@ -4611,3 +4611,53 @@ ocaml_guestfs_du (value gv, value pathv)
CAMLreturn (rv);
}
+CAMLprim value
+ocaml_guestfs_initrd_list (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("initrd_list: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_initrd_list (g, path);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "initrd_list");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_mount_loop (value gv, value filev, value mountpointv)
+{
+ CAMLparam3 (gv, filev, mountpointv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("mount_loop: used handle after closing it");
+
+ const char *file = String_val (filev);
+ const char *mountpoint = String_val (mountpointv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_mount_loop (g, file, mountpoint);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "mount_loop");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+