Generated code for mknod, mkfifo, mknod_b, mknod_c, umask.
[libguestfs.git] / ocaml / guestfs.mli
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.
4  *
5  * Copyright (C) 2009 Red Hat Inc.
6  *
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.
11  *
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.
16  *
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
20  *)
21
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. *)
25
26 type t
27 (** A [guestfs_h] handle. *)
28
29 exception Error of string
30 (** This exception is raised when there is an error. *)
31
32 val create : unit -> t
33
34 val close : t -> unit
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. *)
38
39 type lvm_pv = {
40   pv_name : string;
41   pv_uuid : string;
42   pv_fmt : string;
43   pv_size : int64;
44   dev_size : int64;
45   pv_free : int64;
46   pv_used : int64;
47   pv_attr : string;
48   pv_pe_count : int64;
49   pv_pe_alloc_count : int64;
50   pv_tags : string;
51   pe_start : int64;
52   pv_mda_count : int64;
53   pv_mda_free : int64;
54 }
55
56 type lvm_vg = {
57   vg_name : string;
58   vg_uuid : string;
59   vg_fmt : string;
60   vg_attr : string;
61   vg_size : int64;
62   vg_free : int64;
63   vg_sysid : string;
64   vg_extent_size : int64;
65   vg_extent_count : int64;
66   vg_free_count : int64;
67   max_lv : int64;
68   max_pv : int64;
69   pv_count : int64;
70   lv_count : int64;
71   snap_count : int64;
72   vg_seqno : int64;
73   vg_tags : string;
74   vg_mda_count : int64;
75   vg_mda_free : int64;
76 }
77
78 type lvm_lv = {
79   lv_name : string;
80   lv_uuid : string;
81   lv_attr : string;
82   lv_major : int64;
83   lv_minor : int64;
84   lv_kernel_major : int64;
85   lv_kernel_minor : int64;
86   lv_size : int64;
87   seg_count : int64;
88   origin : string;
89   snap_percent : float option;
90   copy_percent : float option;
91   move_pv : string;
92   lv_tags : string;
93   mirror_log : string;
94   modules : string;
95 }
96
97 type stat = {
98   dev : int64;
99   ino : int64;
100   mode : int64;
101   nlink : int64;
102   uid : int64;
103   gid : int64;
104   rdev : int64;
105   size : int64;
106   blksize : int64;
107   blocks : int64;
108   atime : int64;
109   mtime : int64;
110   ctime : int64;
111 }
112
113 type statvfs = {
114   bsize : int64;
115   frsize : int64;
116   blocks : int64;
117   bfree : int64;
118   bavail : int64;
119   files : int64;
120   ffree : int64;
121   favail : int64;
122   fsid : int64;
123   flag : int64;
124   namemax : int64;
125 }
126
127 val test0 : t -> string -> string option -> string array -> bool -> int -> string -> string -> unit
128 (** internal test function - do not use *)
129
130 val test0rint : t -> string -> int
131 (** internal test function - do not use *)
132
133 val test0rinterr : t -> int
134 (** internal test function - do not use *)
135
136 val test0rint64 : t -> string -> int64
137 (** internal test function - do not use *)
138
139 val test0rint64err : t -> int64
140 (** internal test function - do not use *)
141
142 val test0rbool : t -> string -> bool
143 (** internal test function - do not use *)
144
145 val test0rboolerr : t -> bool
146 (** internal test function - do not use *)
147
148 val test0rconststring : t -> string -> string
149 (** internal test function - do not use *)
150
151 val test0rconststringerr : t -> string
152 (** internal test function - do not use *)
153
154 val test0rstring : t -> string -> string
155 (** internal test function - do not use *)
156
157 val test0rstringerr : t -> string
158 (** internal test function - do not use *)
159
160 val test0rstringlist : t -> string -> string array
161 (** internal test function - do not use *)
162
163 val test0rstringlisterr : t -> string array
164 (** internal test function - do not use *)
165
166 val test0rintbool : t -> string -> int * bool
167 (** internal test function - do not use *)
168
169 val test0rintboolerr : t -> int * bool
170 (** internal test function - do not use *)
171
172 val test0rpvlist : t -> string -> lvm_pv array
173 (** internal test function - do not use *)
174
175 val test0rpvlisterr : t -> lvm_pv array
176 (** internal test function - do not use *)
177
178 val test0rvglist : t -> string -> lvm_vg array
179 (** internal test function - do not use *)
180
181 val test0rvglisterr : t -> lvm_vg array
182 (** internal test function - do not use *)
183
184 val test0rlvlist : t -> string -> lvm_lv array
185 (** internal test function - do not use *)
186
187 val test0rlvlisterr : t -> lvm_lv array
188 (** internal test function - do not use *)
189
190 val test0rstat : t -> string -> stat
191 (** internal test function - do not use *)
192
193 val test0rstaterr : t -> stat
194 (** internal test function - do not use *)
195
196 val test0rstatvfs : t -> string -> statvfs
197 (** internal test function - do not use *)
198
199 val test0rstatvfserr : t -> statvfs
200 (** internal test function - do not use *)
201
202 val test0rhashtable : t -> string -> (string * string) list
203 (** internal test function - do not use *)
204
205 val test0rhashtableerr : t -> (string * string) list
206 (** internal test function - do not use *)
207
208 val launch : t -> unit
209 (** launch the qemu subprocess *)
210
211 val wait_ready : t -> unit
212 (** wait until the qemu subprocess launches *)
213
214 val kill_subprocess : t -> unit
215 (** kill the qemu subprocess *)
216
217 val add_drive : t -> string -> unit
218 (** add an image to examine or modify *)
219
220 val add_cdrom : t -> string -> unit
221 (** add a CD-ROM disk image to examine *)
222
223 val add_drive_ro : t -> string -> unit
224 (** add a drive in snapshot mode (read-only) *)
225
226 val config : t -> string -> string option -> unit
227 (** add qemu parameters *)
228
229 val set_qemu : t -> string -> unit
230 (** set the qemu binary *)
231
232 val get_qemu : t -> string
233 (** get the qemu binary *)
234
235 val set_path : t -> string -> unit
236 (** set the search path *)
237
238 val get_path : t -> string
239 (** get the search path *)
240
241 val set_append : t -> string -> unit
242 (** add options to kernel command line *)
243
244 val get_append : t -> string
245 (** get the additional kernel options *)
246
247 val set_autosync : t -> bool -> unit
248 (** set autosync mode *)
249
250 val get_autosync : t -> bool
251 (** get autosync mode *)
252
253 val set_verbose : t -> bool -> unit
254 (** set verbose mode *)
255
256 val get_verbose : t -> bool
257 (** get verbose mode *)
258
259 val is_ready : t -> bool
260 (** is ready to accept commands *)
261
262 val is_config : t -> bool
263 (** is in configuration state *)
264
265 val is_launching : t -> bool
266 (** is launching subprocess *)
267
268 val is_busy : t -> bool
269 (** is busy processing a command *)
270
271 val get_state : t -> int
272 (** get the current state *)
273
274 val set_busy : t -> unit
275 (** set state to busy *)
276
277 val set_ready : t -> unit
278 (** set state to ready *)
279
280 val end_busy : t -> unit
281 (** leave the busy state *)
282
283 val set_memsize : t -> int -> unit
284 (** set memory allocated to the qemu subprocess *)
285
286 val get_memsize : t -> int
287 (** get memory allocated to the qemu subprocess *)
288
289 val mount : t -> string -> string -> unit
290 (** mount a guest disk at a position in the filesystem *)
291
292 val sync : t -> unit
293 (** sync disks, writes are flushed through to the disk image *)
294
295 val touch : t -> string -> unit
296 (** update file timestamps or create a new file *)
297
298 val cat : t -> string -> string
299 (** list the contents of a file *)
300
301 val ll : t -> string -> string
302 (** list the files in a directory (long format) *)
303
304 val ls : t -> string -> string array
305 (** list the files in a directory *)
306
307 val list_devices : t -> string array
308 (** list the block devices *)
309
310 val list_partitions : t -> string array
311 (** list the partitions *)
312
313 val pvs : t -> string array
314 (** list the LVM physical volumes (PVs) *)
315
316 val vgs : t -> string array
317 (** list the LVM volume groups (VGs) *)
318
319 val lvs : t -> string array
320 (** list the LVM logical volumes (LVs) *)
321
322 val pvs_full : t -> lvm_pv array
323 (** list the LVM physical volumes (PVs) *)
324
325 val vgs_full : t -> lvm_vg array
326 (** list the LVM volume groups (VGs) *)
327
328 val lvs_full : t -> lvm_lv array
329 (** list the LVM logical volumes (LVs) *)
330
331 val read_lines : t -> string -> string array
332 (** read file as lines *)
333
334 val aug_init : t -> string -> int -> unit
335 (** create a new Augeas handle *)
336
337 val aug_close : t -> unit
338 (** close the current Augeas handle *)
339
340 val aug_defvar : t -> string -> string option -> int
341 (** define an Augeas variable *)
342
343 val aug_defnode : t -> string -> string -> string -> int * bool
344 (** define an Augeas node *)
345
346 val aug_get : t -> string -> string
347 (** look up the value of an Augeas path *)
348
349 val aug_set : t -> string -> string -> unit
350 (** set Augeas path to value *)
351
352 val aug_insert : t -> string -> string -> bool -> unit
353 (** insert a sibling Augeas node *)
354
355 val aug_rm : t -> string -> int
356 (** remove an Augeas path *)
357
358 val aug_mv : t -> string -> string -> unit
359 (** move Augeas node *)
360
361 val aug_match : t -> string -> string array
362 (** return Augeas nodes which match path *)
363
364 val aug_save : t -> unit
365 (** write all pending Augeas changes to disk *)
366
367 val aug_load : t -> unit
368 (** load files into the tree *)
369
370 val aug_ls : t -> string -> string array
371 (** list Augeas nodes under a path *)
372
373 val rm : t -> string -> unit
374 (** remove a file *)
375
376 val rmdir : t -> string -> unit
377 (** remove a directory *)
378
379 val rm_rf : t -> string -> unit
380 (** remove a file or directory recursively *)
381
382 val mkdir : t -> string -> unit
383 (** create a directory *)
384
385 val mkdir_p : t -> string -> unit
386 (** create a directory and parents *)
387
388 val chmod : t -> int -> string -> unit
389 (** change file mode *)
390
391 val chown : t -> int -> int -> string -> unit
392 (** change file owner and group *)
393
394 val exists : t -> string -> bool
395 (** test if file or directory exists *)
396
397 val is_file : t -> string -> bool
398 (** test if file exists *)
399
400 val is_dir : t -> string -> bool
401 (** test if file exists *)
402
403 val pvcreate : t -> string -> unit
404 (** create an LVM physical volume *)
405
406 val vgcreate : t -> string -> string array -> unit
407 (** create an LVM volume group *)
408
409 val lvcreate : t -> string -> string -> int -> unit
410 (** create an LVM volume group *)
411
412 val mkfs : t -> string -> string -> unit
413 (** make a filesystem *)
414
415 val sfdisk : t -> string -> int -> int -> int -> string array -> unit
416 (** create partitions on a block device *)
417
418 val write_file : t -> string -> string -> int -> unit
419 (** create a file *)
420
421 val umount : t -> string -> unit
422 (** unmount a filesystem *)
423
424 val mounts : t -> string array
425 (** show mounted filesystems *)
426
427 val umount_all : t -> unit
428 (** unmount all filesystems *)
429
430 val lvm_remove_all : t -> unit
431 (** remove all LVM LVs, VGs and PVs *)
432
433 val file : t -> string -> string
434 (** determine file type *)
435
436 val command : t -> string array -> string
437 (** run a command from the guest filesystem *)
438
439 val command_lines : t -> string array -> string array
440 (** run a command, returning lines *)
441
442 val stat : t -> string -> stat
443 (** get file information *)
444
445 val lstat : t -> string -> stat
446 (** get file information for a symbolic link *)
447
448 val statvfs : t -> string -> statvfs
449 (** get file system statistics *)
450
451 val tune2fs_l : t -> string -> (string * string) list
452 (** get ext2/ext3/ext4 superblock details *)
453
454 val blockdev_setro : t -> string -> unit
455 (** set block device to read-only *)
456
457 val blockdev_setrw : t -> string -> unit
458 (** set block device to read-write *)
459
460 val blockdev_getro : t -> string -> bool
461 (** is block device set to read-only *)
462
463 val blockdev_getss : t -> string -> int
464 (** get sectorsize of block device *)
465
466 val blockdev_getbsz : t -> string -> int
467 (** get blocksize of block device *)
468
469 val blockdev_setbsz : t -> string -> int -> unit
470 (** set blocksize of block device *)
471
472 val blockdev_getsz : t -> string -> int64
473 (** get total size of device in 512-byte sectors *)
474
475 val blockdev_getsize64 : t -> string -> int64
476 (** get total size of device in bytes *)
477
478 val blockdev_flushbufs : t -> string -> unit
479 (** flush device buffers *)
480
481 val blockdev_rereadpt : t -> string -> unit
482 (** reread partition table *)
483
484 val upload : t -> string -> string -> unit
485 (** upload a file from the local machine *)
486
487 val download : t -> string -> string -> unit
488 (** download a file to the local machine *)
489
490 val checksum : t -> string -> string -> string
491 (** compute MD5, SHAx or CRC checksum of file *)
492
493 val tar_in : t -> string -> string -> unit
494 (** unpack tarfile to directory *)
495
496 val tar_out : t -> string -> string -> unit
497 (** pack directory into tarfile *)
498
499 val tgz_in : t -> string -> string -> unit
500 (** unpack compressed tarball to directory *)
501
502 val tgz_out : t -> string -> string -> unit
503 (** pack directory into compressed tarball *)
504
505 val mount_ro : t -> string -> string -> unit
506 (** mount a guest disk, read-only *)
507
508 val mount_options : t -> string -> string -> string -> unit
509 (** mount a guest disk with mount options *)
510
511 val mount_vfs : t -> string -> string -> string -> string -> unit
512 (** mount a guest disk with mount options and vfstype *)
513
514 val debug : t -> string -> string array -> string
515 (** debugging and internals *)
516
517 val lvremove : t -> string -> unit
518 (** remove an LVM logical volume *)
519
520 val vgremove : t -> string -> unit
521 (** remove an LVM volume group *)
522
523 val pvremove : t -> string -> unit
524 (** remove an LVM physical volume *)
525
526 val set_e2label : t -> string -> string -> unit
527 (** set the ext2/3/4 filesystem label *)
528
529 val get_e2label : t -> string -> string
530 (** get the ext2/3/4 filesystem label *)
531
532 val set_e2uuid : t -> string -> string -> unit
533 (** set the ext2/3/4 filesystem UUID *)
534
535 val get_e2uuid : t -> string -> string
536 (** get the ext2/3/4 filesystem UUID *)
537
538 val fsck : t -> string -> string -> int
539 (** run the filesystem checker *)
540
541 val zero : t -> string -> unit
542 (** write zeroes to the device *)
543
544 val grub_install : t -> string -> string -> unit
545 (** install GRUB *)
546
547 val cp : t -> string -> string -> unit
548 (** copy a file *)
549
550 val cp_a : t -> string -> string -> unit
551 (** copy a file or directory recursively *)
552
553 val mv : t -> string -> string -> unit
554 (** move a file *)
555
556 val drop_caches : t -> int -> unit
557 (** drop kernel page cache, dentries and inodes *)
558
559 val dmesg : t -> string
560 (** return kernel messages *)
561
562 val ping_daemon : t -> unit
563 (** ping the guest daemon *)
564
565 val equal : t -> string -> string -> bool
566 (** test if two files have equal contents *)
567
568 val strings : t -> string -> string array
569 (** print the printable strings in a file *)
570
571 val strings_e : t -> string -> string -> string array
572 (** print the printable strings in a file *)
573
574 val hexdump : t -> string -> string
575 (** dump a file in hexadecimal *)
576
577 val zerofree : t -> string -> unit
578 (** zero unused inodes and disk blocks on ext2/3 filesystem *)
579
580 val pvresize : t -> string -> unit
581 (** resize an LVM physical volume *)
582
583 val sfdisk_N : t -> string -> int -> int -> int -> int -> string -> unit
584 (** modify a single partition on a block device *)
585
586 val sfdisk_l : t -> string -> string
587 (** display the partition table *)
588
589 val sfdisk_kernel_geometry : t -> string -> string
590 (** display the kernel geometry *)
591
592 val sfdisk_disk_geometry : t -> string -> string
593 (** display the disk geometry from the partition table *)
594
595 val vg_activate_all : t -> bool -> unit
596 (** activate or deactivate all volume groups *)
597
598 val vg_activate : t -> bool -> string array -> unit
599 (** activate or deactivate some volume groups *)
600
601 val lvresize : t -> string -> int -> unit
602 (** resize an LVM logical volume *)
603
604 val resize2fs : t -> string -> unit
605 (** resize an ext2/ext3 filesystem *)
606
607 val find : t -> string -> string array
608 (** find all files and directories *)
609
610 val e2fsck_f : t -> string -> unit
611 (** check an ext2/ext3 filesystem *)
612
613 val sleep : t -> int -> unit
614 (** sleep for some seconds *)
615
616 val ntfs_3g_probe : t -> bool -> string -> int
617 (** probe NTFS volume *)
618
619 val sh : t -> string -> string
620 (** run a command via the shell *)
621
622 val sh_lines : t -> string -> string array
623 (** run a command via the shell returning lines *)
624
625 val glob_expand : t -> string -> string array
626 (** expand a wildcard path *)
627
628 val scrub_device : t -> string -> unit
629 (** scrub (securely wipe) a device *)
630
631 val scrub_file : t -> string -> unit
632 (** scrub (securely wipe) a file *)
633
634 val scrub_freespace : t -> string -> unit
635 (** scrub (securely wipe) free space *)
636
637 val mkdtemp : t -> string -> string
638 (** create a temporary directory *)
639
640 val wc_l : t -> string -> int
641 (** count lines in a file *)
642
643 val wc_w : t -> string -> int
644 (** count words in a file *)
645
646 val wc_c : t -> string -> int
647 (** count characters in a file *)
648
649 val head : t -> string -> string array
650 (** return first 10 lines of a file *)
651
652 val head_n : t -> int -> string -> string array
653 (** return first N lines of a file *)
654
655 val tail : t -> string -> string array
656 (** return last 10 lines of a file *)
657
658 val tail_n : t -> int -> string -> string array
659 (** return last N lines of a file *)
660
661 val df : t -> string
662 (** report file system disk space usage *)
663
664 val df_h : t -> string
665 (** report file system disk space usage (human readable) *)
666
667 val du : t -> string -> int64
668 (** estimate file space usage *)
669
670 val initrd_list : t -> string -> string array
671 (** list files in an initrd *)
672
673 val mount_loop : t -> string -> string -> unit
674 (** mount a file using the loop device *)
675
676 val mkswap : t -> string -> unit
677 (** create a swap partition *)
678
679 val mkswap_L : t -> string -> string -> unit
680 (** create a swap partition with a label *)
681
682 val mkswap_U : t -> string -> string -> unit
683 (** create a swap partition with an explicit UUID *)
684
685 val mknod : t -> int -> int -> int -> string -> unit
686 (** make block, character or FIFO devices *)
687
688 val mkfifo : t -> int -> string -> unit
689 (** make FIFO (named pipe) *)
690
691 val mknod_b : t -> int -> int -> int -> string -> unit
692 (** make block device node *)
693
694 val mknod_c : t -> int -> int -> int -> string -> unit
695 (** make char device node *)
696
697 val umask : t -> int -> int
698 (** set file mode creation mask (umask) *)
699