1 (* libguestfs generated file
2 * WARNING: THIS FILE IS GENERATED BY 'src/generator.ml'.
3 * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
5 * Copyright (C) 2009 Red Hat Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 (** For API documentation you should refer to the C API
23 in the guestfs(3) manual page. The OCaml API uses almost
24 exactly the same calls. *)
27 (** A [guestfs_h] handle. *)
29 exception Error of string
30 (** This exception is raised when there is an error. *)
32 val create : unit -> t
35 (** Handles are closed by the garbage collector when they become
36 unreferenced, but callers can also call this in order to
37 provide predictable cleanup. *)
49 pv_pe_alloc_count : int64;
64 vg_extent_size : int64;
65 vg_extent_count : int64;
66 vg_free_count : int64;
84 lv_kernel_major : int64;
85 lv_kernel_minor : int64;
89 snap_percent : float option;
90 copy_percent : float option;
97 val launch : t -> unit
98 (** launch the qemu subprocess *)
100 val wait_ready : t -> unit
101 (** wait until the qemu subprocess launches *)
103 val kill_subprocess : t -> unit
104 (** kill the qemu subprocess *)
106 val add_drive : t -> string -> unit
107 (** add an image to examine or modify *)
109 val add_cdrom : t -> string -> unit
110 (** add a CD-ROM disk image to examine *)
112 val config : t -> string -> string option -> unit
113 (** add qemu parameters *)
115 val set_path : t -> string -> unit
116 (** set the search path *)
118 val get_path : t -> string
119 (** get the search path *)
121 val set_autosync : t -> bool -> unit
122 (** set autosync mode *)
124 val get_autosync : t -> bool
125 (** get autosync mode *)
127 val set_verbose : t -> bool -> unit
128 (** set verbose mode *)
130 val get_verbose : t -> bool
131 (** get verbose mode *)
133 val mount : t -> string -> string -> unit
134 (** mount a guest disk at a position in the filesystem *)
137 (** sync disks, writes are flushed through to the disk image *)
139 val touch : t -> string -> unit
140 (** update file timestamps or create a new file *)
142 val cat : t -> string -> string
143 (** list the contents of a file *)
145 val ll : t -> string -> string
146 (** list the files in a directory (long format) *)
148 val ls : t -> string -> string array
149 (** list the files in a directory *)
151 val list_devices : t -> string array
152 (** list the block devices *)
154 val list_partitions : t -> string array
155 (** list the partitions *)
157 val pvs : t -> string array
158 (** list the LVM physical volumes (PVs) *)
160 val vgs : t -> string array
161 (** list the LVM volume groups (VGs) *)
163 val lvs : t -> string array
164 (** list the LVM logical volumes (LVs) *)
166 val pvs_full : t -> lvm_pv array
167 (** list the LVM physical volumes (PVs) *)
169 val vgs_full : t -> lvm_vg array
170 (** list the LVM volume groups (VGs) *)
172 val lvs_full : t -> lvm_lv array
173 (** list the LVM logical volumes (LVs) *)
175 val read_lines : t -> string -> string array
176 (** read file as lines *)
178 val aug_init : t -> string -> int -> unit
179 (** create a new Augeas handle *)
181 val aug_close : t -> unit
182 (** close the current Augeas handle *)
184 val aug_defvar : t -> string -> string option -> int
185 (** define an Augeas variable *)
187 val aug_defnode : t -> string -> string -> string -> int * bool
188 (** define an Augeas node *)
190 val aug_get : t -> string -> string
191 (** look up the value of an Augeas path *)
193 val aug_set : t -> string -> string -> unit
194 (** set Augeas path to value *)
196 val aug_insert : t -> string -> string -> bool -> unit
197 (** insert a sibling Augeas node *)
199 val aug_rm : t -> string -> int
200 (** remove an Augeas path *)
202 val aug_mv : t -> string -> string -> unit
203 (** move Augeas node *)
205 val aug_match : t -> string -> string array
206 (** return Augeas nodes which match path *)
208 val aug_save : t -> unit
209 (** write all pending Augeas changes to disk *)
211 val aug_load : t -> unit
212 (** load files into the tree *)
214 val aug_ls : t -> string -> string array
215 (** list Augeas nodes under a path *)
217 val rm : t -> string -> unit
220 val rmdir : t -> string -> unit
221 (** remove a directory *)
223 val rm_rf : t -> string -> unit
224 (** remove a file or directory recursively *)
226 val mkdir : t -> string -> unit
227 (** create a directory *)
229 val mkdir_p : t -> string -> unit
230 (** create a directory and parents *)
232 val chmod : t -> int -> string -> unit
233 (** change file mode *)
235 val chown : t -> int -> int -> string -> unit
236 (** change file owner and group *)
238 val exists : t -> string -> bool
239 (** test if file or directory exists *)
241 val is_file : t -> string -> bool
242 (** test if file exists *)
244 val is_dir : t -> string -> bool
245 (** test if file exists *)
247 val pvcreate : t -> string -> unit
248 (** create an LVM physical volume *)
250 val vgcreate : t -> string -> string array -> unit
251 (** create an LVM volume group *)
253 val lvcreate : t -> string -> string -> int -> unit
254 (** create an LVM volume group *)
256 val mkfs : t -> string -> string -> unit
257 (** make a filesystem *)
259 val sfdisk : t -> string -> int -> int -> int -> string array -> unit
260 (** create partitions on a block device *)
262 val write_file : t -> string -> string -> int -> unit
265 val umount : t -> string -> unit
266 (** unmount a filesystem *)
268 val mounts : t -> string array
269 (** show mounted filesystems *)
271 val umount_all : t -> unit
272 (** unmount all filesystems *)
274 val lvm_remove_all : t -> unit
275 (** remove all LVM LVs, VGs and PVs *)
277 val file : t -> string -> string
278 (** determine file type *)
280 val command : t -> string array -> string
281 (** run a command from the guest filesystem *)
283 val command_lines : t -> string array -> string array
284 (** run a command, returning lines *)