summaryrefslogtreecommitdiffstats
path: root/ocaml
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-30 18:57:07 +0100
committerRichard Jones <rjones@redhat.com>2009-04-30 18:57:07 +0100
commit0703248d233744047515418893dac05ce013a642 (patch)
treeead0b718136e64b179b9d46f3fc314cdd49f2149 /ocaml
parentc69c3695303d5a660ad093a076c2e364ae6061de (diff)
downloadlibguestfs-0703248d233744047515418893dac05ce013a642.tar.gz
libguestfs-0703248d233744047515418893dac05ce013a642.tar.xz
libguestfs-0703248d233744047515418893dac05ce013a642.zip
Add generated code for 'fsck' command.
Diffstat (limited to 'ocaml')
-rw-r--r--ocaml/guestfs.ml1
-rw-r--r--ocaml/guestfs.mli3
-rw-r--r--ocaml/guestfs_c_actions.c24
3 files changed, 28 insertions, 0 deletions
diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml
index b8511a4f..32e2264e 100644
--- a/ocaml/guestfs.ml
+++ b/ocaml/guestfs.ml
@@ -219,3 +219,4 @@ external set_e2label : t -> string -> string -> unit = "ocaml_guestfs_set_e2labe
external get_e2label : t -> string -> string = "ocaml_guestfs_get_e2label"
external set_e2uuid : t -> string -> string -> unit = "ocaml_guestfs_set_e2uuid"
external get_e2uuid : t -> string -> string = "ocaml_guestfs_get_e2uuid"
+external fsck : t -> string -> string -> int = "ocaml_guestfs_fsck"
diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli
index 291f3401..2cbd7346 100644
--- a/ocaml/guestfs.mli
+++ b/ocaml/guestfs.mli
@@ -436,3 +436,6 @@ val set_e2uuid : t -> string -> string -> unit
val get_e2uuid : t -> string -> string
(** get the ext2/3/4 filesystem UUID *)
+val fsck : t -> string -> string -> int
+(** run the filesystem checker *)
+
diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c
index 9f860bad..22dc18f9 100644
--- a/ocaml/guestfs_c_actions.c
+++ b/ocaml/guestfs_c_actions.c
@@ -2799,3 +2799,27 @@ ocaml_guestfs_get_e2uuid (value gv, value devicev)
CAMLreturn (rv);
}
+CAMLprim value
+ocaml_guestfs_fsck (value gv, value fstypev, value devicev)
+{
+ CAMLparam3 (gv, fstypev, devicev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("fsck: used handle after closing it");
+
+ const char *fstype = String_val (fstypev);
+ const char *device = String_val (devicev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_fsck (g, fstype, device);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "fsck");
+
+ rv = Val_int (r);
+ CAMLreturn (rv);
+}
+