summaryrefslogtreecommitdiffstats
path: root/ocaml
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-06-02 14:25:25 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-06-02 14:25:25 +0100
commitd1a1ab972bb22f4c38a21fcc73f81650aaa03b4e (patch)
tree48c33472221810fbe42a515b217f82d3da3bd04f /ocaml
parentbfdc03be234d6d95f18450846433bce4f97e184c (diff)
downloadlibguestfs-d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e.tar.gz
libguestfs-d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e.tar.xz
libguestfs-d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e.zip
Generated code for 'add_drive_ro' call.
Diffstat (limited to 'ocaml')
-rw-r--r--ocaml/guestfs.ml1
-rw-r--r--ocaml/guestfs.mli3
-rw-r--r--ocaml/guestfs_c_actions.c23
3 files changed, 27 insertions, 0 deletions
diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml
index d218b3e3..cf75d7b9 100644
--- a/ocaml/guestfs.ml
+++ b/ocaml/guestfs.ml
@@ -147,6 +147,7 @@ external wait_ready : t -> unit = "ocaml_guestfs_wait_ready"
external kill_subprocess : t -> unit = "ocaml_guestfs_kill_subprocess"
external add_drive : t -> string -> unit = "ocaml_guestfs_add_drive"
external add_cdrom : t -> string -> unit = "ocaml_guestfs_add_cdrom"
+external add_drive_ro : t -> string -> unit = "ocaml_guestfs_add_drive_ro"
external config : t -> string -> string option -> unit = "ocaml_guestfs_config"
external set_qemu : t -> string -> unit = "ocaml_guestfs_set_qemu"
external get_qemu : t -> string = "ocaml_guestfs_get_qemu"
diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli
index 564f1639..686bc609 100644
--- a/ocaml/guestfs.mli
+++ b/ocaml/guestfs.mli
@@ -220,6 +220,9 @@ val add_drive : t -> string -> unit
val add_cdrom : t -> string -> unit
(** add a CD-ROM disk image to examine *)
+val add_drive_ro : t -> string -> unit
+(** add a drive in snapshot mode (read-only) *)
+
val config : t -> string -> string option -> unit
(** add qemu parameters *)
diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c
index 74c25d9e..73dfdd9f 100644
--- a/ocaml/guestfs_c_actions.c
+++ b/ocaml/guestfs_c_actions.c
@@ -1094,6 +1094,29 @@ ocaml_guestfs_add_cdrom (value gv, value filenamev)
}
CAMLprim value
+ocaml_guestfs_add_drive_ro (value gv, value filenamev)
+{
+ CAMLparam2 (gv, filenamev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("add_drive_ro: used handle after closing it");
+
+ const char *filename = String_val (filenamev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_add_drive_ro (g, filename);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "add_drive_ro");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
ocaml_guestfs_config (value gv, value qemuparamv, value qemuvaluev)
{
CAMLparam3 (gv, qemuparamv, qemuvaluev);