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