diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 11:47:31 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 11:47:31 +0100 |
commit | 8c3b820c2b687345448e3d74a7101b07ff32688e (patch) | |
tree | 0cf5be9515ddcaa1ef6e74c2c55fca5760400c1c /ocaml | |
parent | 632012e6419f04fab93909f92ecbab5a2c590447 (diff) | |
download | libguestfs-8c3b820c2b687345448e3d74a7101b07ff32688e.tar.gz libguestfs-8c3b820c2b687345448e3d74a7101b07ff32688e.tar.xz libguestfs-8c3b820c2b687345448e3d74a7101b07ff32688e.zip |
Generated code for ping-daemon 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 | 22 |
3 files changed, 26 insertions, 0 deletions
diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml index 80e1d399..e4916b07 100644 --- a/ocaml/guestfs.ml +++ b/ocaml/guestfs.ml @@ -227,3 +227,4 @@ external cp_a : t -> string -> string -> unit = "ocaml_guestfs_cp_a" external mv : t -> string -> string -> unit = "ocaml_guestfs_mv" external drop_caches : t -> int -> unit = "ocaml_guestfs_drop_caches" external dmesg : t -> string = "ocaml_guestfs_dmesg" +external ping_daemon : t -> unit = "ocaml_guestfs_ping_daemon" diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli index 810c49a4..125fa979 100644 --- a/ocaml/guestfs.mli +++ b/ocaml/guestfs.mli @@ -460,3 +460,6 @@ val drop_caches : t -> int -> unit val dmesg : t -> string (** return kernel messages *) +val ping_daemon : t -> unit +(** ping the guest daemon *) + diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index 20cb3271..a640e0f3 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -2988,3 +2988,25 @@ ocaml_guestfs_dmesg (value gv) 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); +} + |