Fix 'file(1)' command to work on /dev devices.
[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 val launch : t -> unit
98 (** launch the qemu subprocess *)
99
100 val wait_ready : t -> unit
101 (** wait until the qemu subprocess launches *)
102
103 val kill_subprocess : t -> unit
104 (** kill the qemu subprocess *)
105
106 val add_drive : t -> string -> unit
107 (** add an image to examine or modify *)
108
109 val add_cdrom : t -> string -> unit
110 (** add a CD-ROM disk image to examine *)
111
112 val config : t -> string -> string option -> unit
113 (** add qemu parameters *)
114
115 val set_path : t -> string -> unit
116 (** set the search path *)
117
118 val get_path : t -> string
119 (** get the search path *)
120
121 val set_autosync : t -> bool -> unit
122 (** set autosync mode *)
123
124 val get_autosync : t -> bool
125 (** get autosync mode *)
126
127 val set_verbose : t -> bool -> unit
128 (** set verbose mode *)
129
130 val get_verbose : t -> bool
131 (** get verbose mode *)
132
133 val mount : t -> string -> string -> unit
134 (** mount a guest disk at a position in the filesystem *)
135
136 val sync : t -> unit
137 (** sync disks, writes are flushed through to the disk image *)
138
139 val touch : t -> string -> unit
140 (** update file timestamps or create a new file *)
141
142 val cat : t -> string -> string
143 (** list the contents of a file *)
144
145 val ll : t -> string -> string
146 (** list the files in a directory (long format) *)
147
148 val ls : t -> string -> string array
149 (** list the files in a directory *)
150
151 val list_devices : t -> string array
152 (** list the block devices *)
153
154 val list_partitions : t -> string array
155 (** list the partitions *)
156
157 val pvs : t -> string array
158 (** list the LVM physical volumes (PVs) *)
159
160 val vgs : t -> string array
161 (** list the LVM volume groups (VGs) *)
162
163 val lvs : t -> string array
164 (** list the LVM logical volumes (LVs) *)
165
166 val pvs_full : t -> lvm_pv array
167 (** list the LVM physical volumes (PVs) *)
168
169 val vgs_full : t -> lvm_vg array
170 (** list the LVM volume groups (VGs) *)
171
172 val lvs_full : t -> lvm_lv array
173 (** list the LVM logical volumes (LVs) *)
174
175 val read_lines : t -> string -> string array
176 (** read file as lines *)
177
178 val aug_init : t -> string -> int -> unit
179 (** create a new Augeas handle *)
180
181 val aug_close : t -> unit
182 (** close the current Augeas handle *)
183
184 val aug_defvar : t -> string -> string option -> int
185 (** define an Augeas variable *)
186
187 val aug_defnode : t -> string -> string -> string -> int * bool
188 (** define an Augeas node *)
189
190 val aug_get : t -> string -> string
191 (** look up the value of an Augeas path *)
192
193 val aug_set : t -> string -> string -> unit
194 (** set Augeas path to value *)
195
196 val aug_insert : t -> string -> string -> bool -> unit
197 (** insert a sibling Augeas node *)
198
199 val aug_rm : t -> string -> int
200 (** remove an Augeas path *)
201
202 val aug_mv : t -> string -> string -> unit
203 (** move Augeas node *)
204
205 val aug_match : t -> string -> string array
206 (** return Augeas nodes which match path *)
207
208 val aug_save : t -> unit
209 (** write all pending Augeas changes to disk *)
210
211 val aug_load : t -> unit
212 (** load files into the tree *)
213
214 val aug_ls : t -> string -> string array
215 (** list Augeas nodes under a path *)
216
217 val rm : t -> string -> unit
218 (** remove a file *)
219
220 val rmdir : t -> string -> unit
221 (** remove a directory *)
222
223 val rm_rf : t -> string -> unit
224 (** remove a file or directory recursively *)
225
226 val mkdir : t -> string -> unit
227 (** create a directory *)
228
229 val mkdir_p : t -> string -> unit
230 (** create a directory and parents *)
231
232 val chmod : t -> int -> string -> unit
233 (** change file mode *)
234
235 val chown : t -> int -> int -> string -> unit
236 (** change file owner and group *)
237
238 val exists : t -> string -> bool
239 (** test if file or directory exists *)
240
241 val is_file : t -> string -> bool
242 (** test if file exists *)
243
244 val is_dir : t -> string -> bool
245 (** test if file exists *)
246
247 val pvcreate : t -> string -> unit
248 (** create an LVM physical volume *)
249
250 val vgcreate : t -> string -> string array -> unit
251 (** create an LVM volume group *)
252
253 val lvcreate : t -> string -> string -> int -> unit
254 (** create an LVM volume group *)
255
256 val mkfs : t -> string -> string -> unit
257 (** make a filesystem *)
258
259 val sfdisk : t -> string -> int -> int -> int -> string array -> unit
260 (** create partitions on a block device *)
261
262 val write_file : t -> string -> string -> int -> unit
263 (** create a file *)
264
265 val umount : t -> string -> unit
266 (** unmount a filesystem *)
267
268 val mounts : t -> string array
269 (** show mounted filesystems *)
270
271 val umount_all : t -> unit
272 (** unmount all filesystems *)
273
274 val lvm_remove_all : t -> unit
275 (** remove all LVM LVs, VGs and PVs *)
276
277 val file : t -> string -> string
278 (** determine file type *)
279