diff options
| author | Richard W.M. Jones <rjones@redhat.com> | 2009-04-23 14:39:31 +0100 |
|---|---|---|
| committer | Richard W.M. Jones <rjones@redhat.com> | 2009-04-23 14:39:31 +0100 |
| commit | 8f9f02d483b87c787d089cf9329f5f1b81d3a77e (patch) | |
| tree | ee1c0403092e9dd296c43706a0c7c2d14d5a5c19 /ocaml | |
| parent | 713283f4a67b3a1960ca96ce6608d046fc202d2d (diff) | |
| download | libguestfs-8f9f02d483b87c787d089cf9329f5f1b81d3a77e.tar.gz libguestfs-8f9f02d483b87c787d089cf9329f5f1b81d3a77e.tar.xz libguestfs-8f9f02d483b87c787d089cf9329f5f1b81d3a77e.zip | |
Generated code for debug 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 | 26 |
3 files changed, 30 insertions, 0 deletions
diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml index 96ec6e39..c3305e45 100644 --- a/ocaml/guestfs.ml +++ b/ocaml/guestfs.ml @@ -211,3 +211,4 @@ external tgz_out : t -> string -> string -> unit = "ocaml_guestfs_tgz_out" external mount_ro : t -> string -> string -> unit = "ocaml_guestfs_mount_ro" external mount_options : t -> string -> string -> string -> unit = "ocaml_guestfs_mount_options" external mount_vfs : t -> string -> string -> string -> string -> unit = "ocaml_guestfs_mount_vfs" +external debug : t -> string -> string array -> string = "ocaml_guestfs_debug" diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli index a332f0b4..846332ca 100644 --- a/ocaml/guestfs.mli +++ b/ocaml/guestfs.mli @@ -412,3 +412,6 @@ val mount_options : t -> string -> string -> string -> unit val mount_vfs : t -> string -> string -> string -> string -> unit (** mount a guest disk with mount options and vfstype *) +val debug : t -> string -> string array -> string +(** debugging and internals *) + diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index acf8f922..c396a8a8 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -2608,3 +2608,29 @@ ocaml_guestfs_mount_vfs (value gv, value optionsv, value vfstypev, value devicev CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_debug (value gv, value subcmdv, value extraargsv) +{ + CAMLparam3 (gv, subcmdv, extraargsv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("debug: used handle after closing it"); + + const char *subcmd = String_val (subcmdv); + char **extraargs = ocaml_guestfs_strings_val (extraargsv); + char *r; + + caml_enter_blocking_section (); + r = guestfs_debug (g, subcmd, extraargs); + caml_leave_blocking_section (); + ocaml_guestfs_free_strings (extraargs); + if (r == NULL) + ocaml_guestfs_raise_error (g, "debug"); + + rv = caml_copy_string (r); + free (r); + CAMLreturn (rv); +} + |
