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_qemu : t -> string -> unit
146 (** set the qemu binary *)
148 val get_qemu : t -> string
149 (** get the qemu binary *)
151 val set_path : t -> string -> unit
152 (** set the search path *)
154 val get_path : t -> string
155 (** get the search path *)
157 val set_append : t -> string -> unit
158 (** add options to kernel command line *)
160 val get_append : t -> string
161 (** get the additional kernel options *)
163 val set_autosync : t -> bool -> unit
164 (** set autosync mode *)
166 val get_autosync : t -> bool
167 (** get autosync mode *)
169 val set_verbose : t -> bool -> unit
170 (** set verbose mode *)
172 val get_verbose : t -> bool
173 (** get verbose mode *)
175 val is_ready : t -> bool
176 (** is ready to accept commands *)
178 val is_config : t -> bool
179 (** is in configuration state *)
181 val is_launching : t -> bool
182 (** is launching subprocess *)
184 val is_busy : t -> bool
185 (** is busy processing a command *)
187 val get_state : t -> int
188 (** get the current state *)
190 val set_busy : t -> unit
191 (** set state to busy *)
193 val set_ready : t -> unit
194 (** set state to ready *)
196 val end_busy : t -> unit
197 (** leave the busy state *)
199 val mount : t -> string -> string -> unit
200 (** mount a guest disk at a position in the filesystem *)
203 (** sync disks, writes are flushed through to the disk image *)
205 val touch : t -> string -> unit
206 (** update file timestamps or create a new file *)
208 val cat : t -> string -> string
209 (** list the contents of a file *)
211 val ll : t -> string -> string
212 (** list the files in a directory (long format) *)
214 val ls : t -> string -> string array
215 (** list the files in a directory *)
217 val list_devices : t -> string array
218 (** list the block devices *)
220 val list_partitions : t -> string array
221 (** list the partitions *)
223 val pvs : t -> string array
224 (** list the LVM physical volumes (PVs) *)
226 val vgs : t -> string array
227 (** list the LVM volume groups (VGs) *)
229 val lvs : t -> string array
230 (** list the LVM logical volumes (LVs) *)
232 val pvs_full : t -> lvm_pv array
233 (** list the LVM physical volumes (PVs) *)
235 val vgs_full : t -> lvm_vg array
236 (** list the LVM volume groups (VGs) *)
238 val lvs_full : t -> lvm_lv array
239 (** list the LVM logical volumes (LVs) *)
241 val read_lines : t -> string -> string array
242 (** read file as lines *)
244 val aug_init : t -> string -> int -> unit
245 (** create a new Augeas handle *)
247 val aug_close : t -> unit
248 (** close the current Augeas handle *)
250 val aug_defvar : t -> string -> string option -> int
251 (** define an Augeas variable *)
253 val aug_defnode : t -> string -> string -> string -> int * bool
254 (** define an Augeas node *)
256 val aug_get : t -> string -> string
257 (** look up the value of an Augeas path *)
259 val aug_set : t -> string -> string -> unit
260 (** set Augeas path to value *)
262 val aug_insert : t -> string -> string -> bool -> unit
263 (** insert a sibling Augeas node *)
265 val aug_rm : t -> string -> int
266 (** remove an Augeas path *)
268 val aug_mv : t -> string -> string -> unit
269 (** move Augeas node *)
271 val aug_match : t -> string -> string array
272 (** return Augeas nodes which match path *)
274 val aug_save : t -> unit
275 (** write all pending Augeas changes to disk *)
277 val aug_load : t -> unit
278 (** load files into the tree *)
280 val aug_ls : t -> string -> string array
281 (** list Augeas nodes under a path *)
283 val rm : t -> string -> unit
286 val rmdir : t -> string -> unit
287 (** remove a directory *)
289 val rm_rf : t -> string -> unit
290 (** remove a file or directory recursively *)
292 val mkdir : t -> string -> unit
293 (** create a directory *)
295 val mkdir_p : t -> string -> unit
296 (** create a directory and parents *)
298 val chmod : t -> int -> string -> unit
299 (** change file mode *)
301 val chown : t -> int -> int -> string -> unit
302 (** change file owner and group *)
304 val exists : t -> string -> bool
305 (** test if file or directory exists *)
307 val is_file : t -> string -> bool
308 (** test if file exists *)
310 val is_dir : t -> string -> bool
311 (** test if file exists *)
313 val pvcreate : t -> string -> unit
314 (** create an LVM physical volume *)
316 val vgcreate : t -> string -> string array -> unit
317 (** create an LVM volume group *)
319 val lvcreate : t -> string -> string -> int -> unit
320 (** create an LVM volume group *)
322 val mkfs : t -> string -> string -> unit
323 (** make a filesystem *)
325 val sfdisk : t -> string -> int -> int -> int -> string array -> unit
326 (** create partitions on a block device *)
328 val write_file : t -> string -> string -> int -> unit
331 val umount : t -> string -> unit
332 (** unmount a filesystem *)
334 val mounts : t -> string array
335 (** show mounted filesystems *)
337 val umount_all : t -> unit
338 (** unmount all filesystems *)
340 val lvm_remove_all : t -> unit
341 (** remove all LVM LVs, VGs and PVs *)
343 val file : t -> string -> string
344 (** determine file type *)
346 val command : t -> string array -> string
347 (** run a command from the guest filesystem *)
349 val command_lines : t -> string array -> string array
350 (** run a command, returning lines *)
352 val stat : t -> string -> stat
353 (** get file information *)
355 val lstat : t -> string -> stat
356 (** get file information for a symbolic link *)
358 val statvfs : t -> string -> statvfs
359 (** get file system statistics *)
361 val tune2fs_l : t -> string -> (string * string) list
362 (** get ext2/ext3/ext4 superblock details *)
364 val blockdev_setro : t -> string -> unit
365 (** set block device to read-only *)
367 val blockdev_setrw : t -> string -> unit
368 (** set block device to read-write *)
370 val blockdev_getro : t -> string -> bool
371 (** is block device set to read-only *)
373 val blockdev_getss : t -> string -> int
374 (** get sectorsize of block device *)
376 val blockdev_getbsz : t -> string -> int
377 (** get blocksize of block device *)
379 val blockdev_setbsz : t -> string -> int -> unit
380 (** set blocksize of block device *)
382 val blockdev_getsz : t -> string -> int64
383 (** get total size of device in 512-byte sectors *)
385 val blockdev_getsize64 : t -> string -> int64
386 (** get total size of device in bytes *)
388 val blockdev_flushbufs : t -> string -> unit
389 (** flush device buffers *)
391 val blockdev_rereadpt : t -> string -> unit
392 (** reread partition table *)
394 val upload : t -> string -> string -> unit
395 (** upload a file from the local machine *)
397 val download : t -> string -> string -> unit
398 (** download a file to the local machine *)
400 val checksum : t -> string -> string -> string
401 (** compute MD5, SHAx or CRC checksum of file *)
403 val tar_in : t -> string -> string -> unit
404 (** unpack tarfile to directory *)
406 val tar_out : t -> string -> string -> unit
407 (** pack directory into tarfile *)
409 val tgz_in : t -> string -> string -> unit
410 (** unpack compressed tarball to directory *)
412 val tgz_out : t -> string -> string -> unit
413 (** pack directory into compressed tarball *)
415 val mount_ro : t -> string -> string -> unit
416 (** mount a guest disk, read-only *)
418 val mount_options : t -> string -> string -> string -> unit
419 (** mount a guest disk with mount options *)
421 val mount_vfs : t -> string -> string -> string -> string -> unit
422 (** mount a guest disk with mount options and vfstype *)
424 val debug : t -> string -> string array -> string
425 (** debugging and internals *)
427 val lvremove : t -> string -> unit
428 (** remove an LVM logical volume *)
430 val vgremove : t -> string -> unit
431 (** remove an LVM volume group *)
433 val pvremove : t -> string -> unit
434 (** remove an LVM physical volume *)
436 val set_e2label : t -> string -> string -> unit
437 (** set the ext2/3/4 filesystem label *)
439 val get_e2label : t -> string -> string
440 (** get the ext2/3/4 filesystem label *)
442 val set_e2uuid : t -> string -> string -> unit
443 (** set the ext2/3/4 filesystem UUID *)
445 val get_e2uuid : t -> string -> string
446 (** get the ext2/3/4 filesystem UUID *)
448 val fsck : t -> string -> string -> int
449 (** run the filesystem checker *)
451 val zero : t -> string -> unit
452 (** write zeroes to the device *)
454 val grub_install : t -> string -> string -> unit
457 val cp : t -> string -> string -> unit
460 val cp_a : t -> string -> string -> unit
461 (** copy a file or directory recursively *)
463 val mv : t -> string -> string -> unit
466 val drop_caches : t -> int -> unit
467 (** drop kernel page cache, dentries and inodes *)
469 val dmesg : t -> string
470 (** return kernel messages *)
472 val ping_daemon : t -> unit
473 (** ping the guest daemon *)
475 val equal : t -> string -> string -> bool
476 (** test if two files have equal contents *)
478 val strings : t -> string -> string array
479 (** print the printable strings in a file *)
481 val strings_e : t -> string -> string -> string array
482 (** print the printable strings in a file *)
484 val hexdump : t -> string -> string
485 (** dump a file in hexadecimal *)
487 val zerofree : t -> string -> unit
488 (** zero unused inodes and disk blocks on ext2/3 filesystem *)
490 val pvresize : t -> string -> unit
491 (** resize an LVM physical volume *)
493 val sfdisk_N : t -> string -> int -> int -> int -> int -> string -> unit
494 (** modify a single partition on a block device *)
496 val sfdisk_l : t -> string -> string
497 (** display the partition table *)
499 val sfdisk_kernel_geometry : t -> string -> string
500 (** display the kernel geometry *)
502 val sfdisk_disk_geometry : t -> string -> string
503 (** display the disk geometry from the partition table *)
505 val vg_activate_all : t -> bool -> unit
506 (** activate or deactivate all volume groups *)
508 val vg_activate : t -> bool -> string array -> unit
509 (** activate or deactivate some volume groups *)
511 val lvresize : t -> string -> int -> unit
512 (** resize an LVM logical volume *)
514 val resize2fs : t -> string -> unit
515 (** resize an ext2/ext3 filesystem *)
517 val find : t -> string -> string array
518 (** find all files and directories *)
520 val e2fsck_f : t -> string -> unit
521 (** check an ext2/ext3 filesystem *)