- else this command will fail. *)
-
-val open_images : string list -> rw_flag callback -> unit
- (** [open_images images cb] is like {!open_domain} except
- that it opens local disk image(s) directly. *)
-
-type volume = {
- vol_device : string;
- vol_type : string;
- vol_label : string;
- vol_uuid : string;
- vol_statvfs : Guestfs.statvfs;
-}
- (** The volume structure which is passed to the {!get_volumes} callback. *)
-
-val get_volumes : volume callback -> unit
- (** [get_volumes cb] sends the [Get_volumes] message to the
- slave thread.
-
- This causes the slave thread to examine all partitions, LVs
- etc within the current disk image, and for each that contains
- a mountable filesystem, [cb] is called. (Note [cb] can be
- called multiple times). *)
-
-type direntry = {
- dent_name : string; (** Basename in directory. *)
- dent_stat : Guestfs.stat; (** stat(2) for this entry. *)
- dent_link : string; (** (for symlinks only) readlink(2). *)
-}
-
-val read_directory : string -> string -> direntry list callback -> unit
- (** [read_directory dev dir cb] sends the [Read_directory] message
- to the slave thread.
-
- This causes the slave thread to read the contents of the
- directory [dir] from volume [dev], and call [cb] with the
- complete result. If [dir] is not a directory then this
- is an error.
-
- Note that [.] and [..] entries are not included in the result,
- and the list is sorted on the [filename] field. *)
-
-val disk_usage : string -> string -> int64 callback -> unit
- (** [disk_usage dev dir cb] sends the [Disk_usage] message to the
- slave thread.
-
- This causes the slave thread to estimate the disk usage of the
- directory (or file) [dir] from volume [dev], and call [cb] with
- the result (size in {b kilobytes}). *)
-
-type export_t =
- | Export_tar (** uncompressed tar archive *)
- | Export_tgz (** gzip compressed tar archive *)
- | Export_checksums of string (** checksums using algorithm *)
- | Export_list (** list of file names, \0-separated *)
- (** Export format used by {!export_dir_to}. *)
-
-val export_dir_to : export_t -> string -> string -> string -> unit callback -> unit
- (** [export_dir_to t dev dir file cb] sends the [Export_dir_to] message
- to the slave thread.
-
- This causes the slave thread to export the directory [dir] on
- device [dev] to the host file called [file]. The precise
- operation (ie. what is exported) is controlled by the type
- [export_t]. When the export has been completed, the callback
- [cb] is called in the main thread.
-
- Libguestfs doesn't offer any way to view progress of this
- operation, which could potentially take a long time. *)
+ else this command will fail.
+
+ If [fail] is passed, then failures cause this callback to
+ be called. If not, the global failure hook is called. *)
+
+val open_images : ?fail:exn callback -> (string * string option) list -> Slave_types.inspection_data callback -> unit
+ (** [open_images images cb] is like {!open_domain} except that it
+ opens local disk image(s) directly. [images] is a list of
+ [(filename, format)] pairs.
+
+ If [fail] is passed, then failures cause this callback to
+ be called. If not, the global failure hook is called. *)
+
+val read_directory : ?fail:exn callback -> Slave_types.source -> string -> Slave_types.direntry list callback -> unit
+ (** [read_directory src dir cb] reads the contents of the directory
+ [dir] from source [src], and calls the callback function [cb]
+ with the resulting list of directory entries, if successful.
+
+ The source may be either a filesystem (if [src] is [Volume
+ dev]), or a fully mounted up operating system (if [src] is [OS ...]).
+ In the second case all the mountpoints of the operating system
+ are mounted up so that the path may span mountpoints in the
+ natural way.
+
+ If [fail] is passed, then failures cause this callback to
+ be called. If not, the global failure hook is called. *)
+
+val run_command : ?fail:exn callback -> string -> unit callback -> unit
+ (** [run_command cmd] runs an external command [cmd]. This is
+ useful for possibly long-running commands as it keeps the
+ display interactive. Be careful to quote arguments in the
+ command properly (see {!Filename.quote}). The external command
+ must eventually terminate and must not wait for user input. *)