X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=ocaml%2Fguestfs_c_actions.c;h=7732e1c6f6feb4440e1551da3cc0da92563d8928;hb=4b382eb8110050cb5b769c6f7d79b0b77eb79719;hp=d6d13053019651b1a381f6183b8e622981794202;hpb=9222136ac9b2e404dba128b1ac74dacaa8bf1038;p=libguestfs.git diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index d6d1305..7732e1c 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -2965,3 +2965,72 @@ ocaml_guestfs_drop_caches (value gv, value whattodropv) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_dmesg (value gv) +{ + CAMLparam1 (gv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("dmesg: used handle after closing it"); + + char *r; + + caml_enter_blocking_section (); + r = guestfs_dmesg (g); + caml_leave_blocking_section (); + if (r == NULL) + ocaml_guestfs_raise_error (g, "dmesg"); + + rv = caml_copy_string (r); + free (r); + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_ping_daemon (value gv) +{ + CAMLparam1 (gv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("ping_daemon: used handle after closing it"); + + int r; + + caml_enter_blocking_section (); + r = guestfs_ping_daemon (g); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "ping_daemon"); + + rv = Val_unit; + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_equal (value gv, value file1v, value file2v) +{ + CAMLparam3 (gv, file1v, file2v); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("equal: used handle after closing it"); + + const char *file1 = String_val (file1v); + const char *file2 = String_val (file2v); + int r; + + caml_enter_blocking_section (); + r = guestfs_equal (g, file1, file2); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "equal"); + + rv = Val_bool (r); + CAMLreturn (rv); +} +