diff options
author | Richard Jones <rjones@redhat.com> | 2009-05-18 20:22:53 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-05-18 20:22:53 +0100 |
commit | ca49c50e06834bbc68e21630a5552c57494f2b53 (patch) | |
tree | 0d1c98fd038abf05d7491f044c8affbfb461ce00 /ocaml | |
parent | 0695593702b8612b500ff0b3bf800e5934f9b56e (diff) | |
download | libguestfs-ca49c50e06834bbc68e21630a5552c57494f2b53.tar.gz libguestfs-ca49c50e06834bbc68e21630a5552c57494f2b53.tar.xz libguestfs-ca49c50e06834bbc68e21630a5552c57494f2b53.zip |
Generated code for lvresize, resize2fs.
Diffstat (limited to 'ocaml')
-rw-r--r-- | ocaml/guestfs.ml | 2 | ||||
-rw-r--r-- | ocaml/guestfs.mli | 6 | ||||
-rw-r--r-- | ocaml/guestfs_c_actions.c | 47 |
3 files changed, 55 insertions, 0 deletions
diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml index fa60a7bb..561b93c3 100644 --- a/ocaml/guestfs.ml +++ b/ocaml/guestfs.ml @@ -243,3 +243,5 @@ external sfdisk_kernel_geometry : t -> string -> string = "ocaml_guestfs_sfdisk_ external sfdisk_disk_geometry : t -> string -> string = "ocaml_guestfs_sfdisk_disk_geometry" external vg_activate_all : t -> bool -> unit = "ocaml_guestfs_vg_activate_all" external vg_activate : t -> bool -> string array -> unit = "ocaml_guestfs_vg_activate" +external lvresize : t -> string -> int -> unit = "ocaml_guestfs_lvresize" +external resize2fs : t -> string -> unit = "ocaml_guestfs_resize2fs" diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli index 5ce91220..d9ce4af5 100644 --- a/ocaml/guestfs.mli +++ b/ocaml/guestfs.mli @@ -508,3 +508,9 @@ val vg_activate_all : t -> bool -> unit val vg_activate : t -> bool -> string array -> unit (** activate or deactivate some volume groups *) +val lvresize : t -> string -> int -> unit +(** resize an LVM logical volume *) + +val resize2fs : t -> string -> unit +(** resize an ext2/ext3 filesystem *) + diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index f0aa7e23..c64bcf09 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -3379,3 +3379,50 @@ ocaml_guestfs_vg_activate (value gv, value activatev, value volgroupsv) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_lvresize (value gv, value devicev, value mbytesv) +{ + CAMLparam3 (gv, devicev, mbytesv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("lvresize: used handle after closing it"); + + const char *device = String_val (devicev); + int mbytes = Int_val (mbytesv); + int r; + + caml_enter_blocking_section (); + r = guestfs_lvresize (g, device, mbytes); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "lvresize"); + + rv = Val_unit; + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_resize2fs (value gv, value devicev) +{ + CAMLparam2 (gv, devicev); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("resize2fs: used handle after closing it"); + + const char *device = String_val (devicev); + int r; + + caml_enter_blocking_section (); + r = guestfs_resize2fs (g, device); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "resize2fs"); + + rv = Val_unit; + CAMLreturn (rv); +} + |