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;
127 val launch : t -> unit
128 (** launch the qemu subprocess *)
130 val wait_ready : t -> unit
131 (** wait until the qemu subprocess launches *)
133 val kill_subprocess : t -> unit
134 (** kill the qemu subprocess *)
136 val add_drive : t -> string -> unit
137 (** add an image to examine or modify *)
139 val add_cdrom : t -> string -> unit
140 (** add a CD-ROM disk image to examine *)
142 val config : t -> string -> string option -> unit
143 (** add qemu parameters *)
145 val set_path : t -> string -> unit
146 (** set the search path *)
148 val get_path : t -> string
149 (** get the search path *)
151 val set_autosync : t -> bool -> unit
152 (** set autosync mode *)
154 val get_autosync : t -> bool
155 (** get autosync mode *)
157 val set_verbose : t -> bool -> unit
158 (** set verbose mode *)
160 val get_verbose : t -> bool
161 (** get verbose mode *)
163 val mount : t -> string -> string -> unit
164 (** mount a guest disk at a position in the filesystem *)
167 (** sync disks, writes are flushed through to the disk image *)
169 val touch : t -> string -> unit
170 (** update file timestamps or create a new file *)
172 val cat : t -> string -> string
173 (** list the contents of a file *)
175 val ll : t -> string -> string
176 (** list the files in a directory (long format) *)
178 val ls : t -> string -> string array
179 (** list the files in a directory *)
181 val list_devices : t -> string array
182 (** list the block devices *)
184 val list_partitions : t -> string array
185 (** list the partitions *)
187 val pvs : t -> string array
188 (** list the LVM physical volumes (PVs) *)
190 val vgs : t -> string array
191 (** list the LVM volume groups (VGs) *)
193 val lvs : t -> string array
194 (** list the LVM logical volumes (LVs) *)
196 val pvs_full : t -> lvm_pv array
197 (** list the LVM physical volumes (PVs) *)
199 val vgs_full : t -> lvm_vg array
200 (** list the LVM volume groups (VGs) *)
202 val lvs_full : t -> lvm_lv array
203 (** list the LVM logical volumes (LVs) *)
205 val read_lines : t -> string -> string array
206 (** read file as lines *)
208 val aug_init : t -> string -> int -> unit
209 (** create a new Augeas handle *)
211 val aug_close : t -> unit
212 (** close the current Augeas handle *)
214 val aug_defvar : t -> string -> string option -> int
215 (** define an Augeas variable *)
217 val aug_defnode : t -> string -> string -> string -> int * bool
218 (** define an Augeas node *)
220 val aug_get : t -> string -> string
221 (** look up the value of an Augeas path *)
223 val aug_set : t -> string -> string -> unit
224 (** set Augeas path to value *)
226 val aug_insert : t -> string -> string -> bool -> unit
227 (** insert a sibling Augeas node *)
229 val aug_rm : t -> string -> int
230 (** remove an Augeas path *)
232 val aug_mv : t -> string -> string -> unit
233 (** move Augeas node *)
235 val aug_match : t -> string -> string array
236 (** return Augeas nodes which match path *)
238 val aug_save : t -> unit
239 (** write all pending Augeas changes to disk *)
241 val aug_load : t -> unit
242 (** load files into the tree *)
244 val aug_ls : t -> string -> string array
245 (** list Augeas nodes under a path *)
247 val rm : t -> string -> unit
250 val rmdir : t -> string -> unit
251 (** remove a directory *)
253 val rm_rf : t -> string -> unit
254 (** remove a file or directory recursively *)
256 val mkdir : t -> string -> unit
257 (** create a directory *)
259 val mkdir_p : t -> string -> unit
260 (** create a directory and parents *)
262 val chmod : t -> int -> string -> unit
263 (** change file mode *)
265 val chown : t -> int -> int -> string -> unit
266 (** change file owner and group *)
268 val exists : t -> string -> bool
269 (** test if file or directory exists *)
271 val is_file : t -> string -> bool
272 (** test if file exists *)
274 val is_dir : t -> string -> bool
275 (** test if file exists *)
277 val pvcreate : t -> string -> unit
278 (** create an LVM physical volume *)
280 val vgcreate : t -> string -> string array -> unit
281 (** create an LVM volume group *)
283 val lvcreate : t -> string -> string -> int -> unit
284 (** create an LVM volume group *)
286 val mkfs : t -> string -> string -> unit
287 (** make a filesystem *)
289 val sfdisk : t -> string -> int -> int -> int -> string array -> unit
290 (** create partitions on a block device *)
292 val write_file : t -> string -> string -> int -> unit
295 val umount : t -> string -> unit
296 (** unmount a filesystem *)
298 val mounts : t -> string array
299 (** show mounted filesystems *)
301 val umount_all : t -> unit
302 (** unmount all filesystems *)
304 val lvm_remove_all : t -> unit
305 (** remove all LVM LVs, VGs and PVs *)
307 val file : t -> string -> string
308 (** determine file type *)
310 val command : t -> string array -> string
311 (** run a command from the guest filesystem *)
313 val command_lines : t -> string array -> string array
314 (** run a command, returning lines *)
316 val stat : t -> string -> stat
317 (** get file information *)
319 val lstat : t -> string -> stat
320 (** get file information for a symbolic link *)
322 val statvfs : t -> string -> statvfs
323 (** get file system statistics *)
325 val tune2fs_l : t -> string -> (string * string) list
326 (** get ext2/ext3 superblock details *)
328 val blockdev_setro : t -> string -> unit
329 (** set block device to read-only *)
331 val blockdev_setrw : t -> string -> unit
332 (** set block device to read-write *)
334 val blockdev_getro : t -> string -> bool
335 (** is block device set to read-only *)
337 val blockdev_getss : t -> string -> int
338 (** get sectorsize of block device *)
340 val blockdev_getbsz : t -> string -> int
341 (** get blocksize of block device *)
343 val blockdev_setbsz : t -> string -> int -> unit
344 (** set blocksize of block device *)
346 val blockdev_getsz : t -> string -> int64
347 (** get total size of device in 512-byte sectors *)
349 val blockdev_getsize64 : t -> string -> int64
350 (** get total size of device in bytes *)
352 val blockdev_flushbufs : t -> string -> unit
353 (** flush device buffers *)
355 val blockdev_rereadpt : t -> string -> unit
356 (** reread partition table *)