diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 16:05:22 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 16:05:22 +0100 |
commit | 5d6b6a3fbbfea19c606b984bac9cf64b6b81cafe (patch) | |
tree | b1d34b141b935fc6acc46930acd0496dfcc0df8b /ocaml | |
parent | a548d51b703f5385797594a37287f4532af289a2 (diff) | |
download | libguestfs-5d6b6a3fbbfea19c606b984bac9cf64b6b81cafe.tar.gz libguestfs-5d6b6a3fbbfea19c606b984bac9cf64b6b81cafe.tar.xz libguestfs-5d6b6a3fbbfea19c606b984bac9cf64b6b81cafe.zip |
Generated code for mount-loop command.
Diffstat (limited to 'ocaml')
-rw-r--r-- | ocaml/guestfs.ml | 1 | ||||
-rw-r--r-- | ocaml/guestfs.mli | 3 | ||||
-rw-r--r-- | ocaml/guestfs_c_actions.c | 24 |
3 files changed, 28 insertions, 0 deletions
diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml index 33c0276e..d9b652b7 100644 --- a/ocaml/guestfs.ml +++ b/ocaml/guestfs.ml @@ -295,3 +295,4 @@ external df : t -> string = "ocaml_guestfs_df" external df_h : t -> string = "ocaml_guestfs_df_h" external du : t -> string -> int64 = "ocaml_guestfs_du" external initrd_list : t -> string -> string array = "ocaml_guestfs_initrd_list" +external mount_loop : t -> string -> string -> unit = "ocaml_guestfs_mount_loop" diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli index 988d9de6..612d0022 100644 --- a/ocaml/guestfs.mli +++ b/ocaml/guestfs.mli @@ -664,3 +664,6 @@ val du : t -> string -> int64 val initrd_list : t -> string -> string array (** list files in an initrd *) +val mount_loop : t -> string -> string -> unit +(** mount a file using the loop device *) + diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index 6385e806..8b018f6e 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -4637,3 +4637,27 @@ ocaml_guestfs_initrd_list (value gv, value pathv) 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); +} + |