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 is_ready : t -> bool
164 (** is ready to accept commands *)
166 val is_config : t -> bool
167 (** is in configuration state *)
169 val is_launching : t -> bool
170 (** is launching subprocess *)
172 val is_busy : t -> bool
173 (** is busy processing a command *)
175 val get_state : t -> int
176 (** get the current state *)
178 val mount : t -> string -> string -> unit
179 (** mount a guest disk at a position in the filesystem *)
182 (** sync disks, writes are flushed through to the disk image *)
184 val touch : t -> string -> unit
185 (** update file timestamps or create a new file *)
187 val cat : t -> string -> string
188 (** list the contents of a file *)
190 val ll : t -> string -> string
191 (** list the files in a directory (long format) *)
193 val ls : t -> string -> string array
194 (** list the files in a directory *)
196 val list_devices : t -> string array
197 (** list the block devices *)
199 val list_partitions : t -> string array
200 (** list the partitions *)
202 val pvs : t -> string array
203 (** list the LVM physical volumes (PVs) *)
205 val vgs : t -> string array
206 (** list the LVM volume groups (VGs) *)
208 val lvs : t -> string array
209 (** list the LVM logical volumes (LVs) *)
211 val pvs_full : t -> lvm_pv array
212 (** list the LVM physical volumes (PVs) *)
214 val vgs_full : t -> lvm_vg array
215 (** list the LVM volume groups (VGs) *)
217 val lvs_full : t -> lvm_lv array
218 (** list the LVM logical volumes (LVs) *)
220 val read_lines : t -> string -> string array
221 (** read file as lines *)
223 val aug_init : t -> string -> int -> unit
224 (** create a new Augeas handle *)
226 val aug_close : t -> unit
227 (** close the current Augeas handle *)
229 val aug_defvar : t -> string -> string option -> int
230 (** define an Augeas variable *)
232 val aug_defnode : t -> string -> string -> string -> int * bool
233 (** define an Augeas node *)
235 val aug_get : t -> string -> string
236 (** look up the value of an Augeas path *)
238 val aug_set : t -> string -> string -> unit
239 (** set Augeas path to value *)
241 val aug_insert : t -> string -> string -> bool -> unit
242 (** insert a sibling Augeas node *)
244 val aug_rm : t -> string -> int
245 (** remove an Augeas path *)
247 val aug_mv : t -> string -> string -> unit
248 (** move Augeas node *)
250 val aug_match : t -> string -> string array
251 (** return Augeas nodes which match path *)
253 val aug_save : t -> unit
254 (** write all pending Augeas changes to disk *)
256 val aug_load : t -> unit
257 (** load files into the tree *)
259 val aug_ls : t -> string -> string array
260 (** list Augeas nodes under a path *)
262 val rm : t -> string -> unit
265 val rmdir : t -> string -> unit
266 (** remove a directory *)
268 val rm_rf : t -> string -> unit
269 (** remove a file or directory recursively *)
271 val mkdir : t -> string -> unit
272 (** create a directory *)
274 val mkdir_p : t -> string -> unit
275 (** create a directory and parents *)
277 val chmod : t -> int -> string -> unit
278 (** change file mode *)
280 val chown : t -> int -> int -> string -> unit
281 (** change file owner and group *)
283 val exists : t -> string -> bool
284 (** test if file or directory exists *)
286 val is_file : t -> string -> bool
287 (** test if file exists *)
289 val is_dir : t -> string -> bool
290 (** test if file exists *)
292 val pvcreate : t -> string -> unit
293 (** create an LVM physical volume *)
295 val vgcreate : t -> string -> string array -> unit
296 (** create an LVM volume group *)
298 val lvcreate : t -> string -> string -> int -> unit
299 (** create an LVM volume group *)
301 val mkfs : t -> string -> string -> unit
302 (** make a filesystem *)
304 val sfdisk : t -> string -> int -> int -> int -> string array -> unit
305 (** create partitions on a block device *)
307 val write_file : t -> string -> string -> int -> unit
310 val umount : t -> string -> unit
311 (** unmount a filesystem *)
313 val mounts : t -> string array
314 (** show mounted filesystems *)
316 val umount_all : t -> unit
317 (** unmount all filesystems *)
319 val lvm_remove_all : t -> unit
320 (** remove all LVM LVs, VGs and PVs *)
322 val file : t -> string -> string
323 (** determine file type *)
325 val command : t -> string array -> string
326 (** run a command from the guest filesystem *)
328 val command_lines : t -> string array -> string array
329 (** run a command, returning lines *)
331 val stat : t -> string -> stat
332 (** get file information *)
334 val lstat : t -> string -> stat
335 (** get file information for a symbolic link *)
337 val statvfs : t -> string -> statvfs
338 (** get file system statistics *)
340 val tune2fs_l : t -> string -> (string * string) list
341 (** get ext2/ext3 superblock details *)
343 val blockdev_setro : t -> string -> unit
344 (** set block device to read-only *)
346 val blockdev_setrw : t -> string -> unit
347 (** set block device to read-write *)
349 val blockdev_getro : t -> string -> bool
350 (** is block device set to read-only *)
352 val blockdev_getss : t -> string -> int
353 (** get sectorsize of block device *)
355 val blockdev_getbsz : t -> string -> int
356 (** get blocksize of block device *)
358 val blockdev_setbsz : t -> string -> int -> unit
359 (** set blocksize of block device *)
361 val blockdev_getsz : t -> string -> int64
362 (** get total size of device in 512-byte sectors *)
364 val blockdev_getsize64 : t -> string -> int64
365 (** get total size of device in bytes *)
367 val blockdev_flushbufs : t -> string -> unit
368 (** flush device buffers *)
370 val blockdev_rereadpt : t -> string -> unit
371 (** reread partition table *)
373 val upload : t -> string -> string -> unit
374 (** upload a file from the local machine *)
376 val download : t -> string -> string -> unit
377 (** download a file to the local machine *)