X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=ocaml%2Fguestfs_c_actions.c;h=45c9883f6ad93caa5f1561d49759145165b39825;hb=6654f617a6f720baa8f1ced89179e11679353d1e;hp=74c25d9ef6ad36874afcf3e649635a199da5b34d;hpb=c41fe04a652437c920acb0e820762c53bf44a139;p=libguestfs.git diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index 74c25d9..45c9883 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); @@ -4128,3 +4151,50 @@ ocaml_guestfs_e2fsck_f (value gv, value devicev) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_sleep (value gv, value secsv) +{ + CAMLparam2 (gv, secsv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("sleep: used handle after closing it"); + + int secs = Int_val (secsv); + int r; + + caml_enter_blocking_section (); + r = guestfs_sleep (g, secs); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "sleep"); + + rv = Val_unit; + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_ntfs_3g_probe (value gv, value rwv, value devicev) +{ + CAMLparam3 (gv, rwv, devicev); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("ntfs_3g_probe: used handle after closing it"); + + int rw = Bool_val (rwv); + const char *device = String_val (devicev); + int r; + + caml_enter_blocking_section (); + r = guestfs_ntfs_3g_probe (g, rw, device); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "ntfs_3g_probe"); + + rv = Val_int (r); + CAMLreturn (rv); +} +