diff options
author | Richard Jones <rjones@redhat.com> | 2009-05-18 17:16:24 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-05-18 17:16:24 +0100 |
commit | 85ed8cef99c19b4143844991d14e0b848fecc5da (patch) | |
tree | 61e34886d4ec4b59a37c8e4ab6779e7ef7834f34 /ocaml | |
parent | adf0974245af914c46b48766d0efdd5ee8608dda (diff) | |
download | libguestfs-85ed8cef99c19b4143844991d14e0b848fecc5da.tar.gz libguestfs-85ed8cef99c19b4143844991d14e0b848fecc5da.tar.xz libguestfs-85ed8cef99c19b4143844991d14e0b848fecc5da.zip |
Add vg-activate{,-all} commands, and resize recipe.
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 | 48 |
3 files changed, 56 insertions, 0 deletions
diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml index d50b2d8c..fa60a7bb 100644 --- a/ocaml/guestfs.ml +++ b/ocaml/guestfs.ml @@ -241,3 +241,5 @@ external sfdisk_N : t -> string -> int -> int -> int -> int -> string -> unit = external sfdisk_l : t -> string -> string = "ocaml_guestfs_sfdisk_l" external sfdisk_kernel_geometry : t -> string -> string = "ocaml_guestfs_sfdisk_kernel_geometry" 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" diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli index 358a6d30..5ce91220 100644 --- a/ocaml/guestfs.mli +++ b/ocaml/guestfs.mli @@ -502,3 +502,9 @@ val sfdisk_kernel_geometry : t -> string -> string val sfdisk_disk_geometry : t -> string -> string (** display the disk geometry from the partition table *) +val vg_activate_all : t -> bool -> unit +(** activate or deactivate all volume groups *) + +val vg_activate : t -> bool -> string array -> unit +(** activate or deactivate some volume groups *) + diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index f2d13b03..f0aa7e23 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -3331,3 +3331,51 @@ ocaml_guestfs_sfdisk_disk_geometry (value gv, value devicev) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_vg_activate_all (value gv, value activatev) +{ + CAMLparam2 (gv, activatev); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("vg_activate_all: used handle after closing it"); + + int activate = Bool_val (activatev); + int r; + + caml_enter_blocking_section (); + r = guestfs_vg_activate_all (g, activate); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "vg_activate_all"); + + rv = Val_unit; + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_vg_activate (value gv, value activatev, value volgroupsv) +{ + CAMLparam3 (gv, activatev, volgroupsv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("vg_activate: used handle after closing it"); + + int activate = Bool_val (activatev); + char **volgroups = ocaml_guestfs_strings_val (g, volgroupsv); + int r; + + caml_enter_blocking_section (); + r = guestfs_vg_activate (g, activate, volgroups); + caml_leave_blocking_section (); + ocaml_guestfs_free_strings (volgroups); + if (r == -1) + ocaml_guestfs_raise_error (g, "vg_activate"); + + rv = Val_unit; + CAMLreturn (rv); +} + |