- doesn't make sense to use remote URIs. *)
-
-type domain = {
- dom_id : int;
- dom_name : string;
- dom_state : Libvirt.Domain.state;
-}
- (** List of domains as returned in the [Get_domains] message callback.
-
- Note that [dom_state] is the state of the domain and should
- control whether we are allowed to write to the domain's
- filesystem (disallowed if [dom_state] is not [InfoShutoff]). *)
-
-val get_domains : domain list callback -> unit
- (** [get_domains cb] sends the [Get_domains] message to the
- slave thread.
-
- This causes the slave thread to retrieve the list of domains
- from libvirt (active and inactive ones). If this succeeds,
- [cb] is called in the main thread with the list of
- domains. See also the {!domain} type. *)
-
-type rw_flag = RO | RW
- (** This flag is passed to open callbacks to indicate whether
- we could open the disks read-only ([RO]) or read-write ([RW]). *)
-
-val open_domain : string -> rw_flag callback -> unit
- (** [open_domain name cb] sends the [Open_domain] message to the
- slave thread.
-
- This causes the slave thread to retrieve the list of
- block devices for the libvirt domain [name], create a
- libguestfs handle, add those block devices, and launch
- the handle. If this is successful, then [cb] is called
- in the main thread.
-
- If the domain is live then the disks are opened read only,
- else they are opened read write if write_flag is true.
- The [rw_flag] is passed into the callback accordingly.
+ doesn't make sense to use remote URIs.
+
+ If [fail] is passed, then failures cause this callback to
+ be called. If not, the global failure hook is called. *)
+
+val disk_usage : ?fail:exn callback -> Slave_types.source -> string -> int64 callback -> unit
+ (** [disk_usage src pathname cb] calculates the disk usage of
+ directory [pathname] and calls the callback with the answer
+ (size of {b kilobytes}). *)
+
+val download_dir_tarball : ?fail:exn callback -> Slave_types.source -> string -> Slave_types.download_dir_tarball_format -> string -> unit callback -> unit
+ (** [download_dir_tarball_format src pathname format localfile cb]
+ downloads directory [pathname] to the named local file (a
+ tarball), and then calls the callback function.
+
+ [format] controls the download format, which is one of
+ uncompressed tar, gzip-compressed tar, or xz-compressed tar. *)
+
+val download_dir_find0 : ?fail:exn callback -> Slave_types.source -> string -> string -> unit callback -> unit
+ (** [download_dir_find0 src pathname localfile cb] downloads the
+ list of filenames of directory [pathname] to the named local
+ file (a ASCII NUL-separated text file), and then calls the
+ callback function. *)
+
+val download_file : ?fail:exn callback -> Slave_types.source -> string -> string -> unit callback -> unit
+ (** [download_file src pathname localfile cb] downloads [pathname]
+ to the named local file, and then calls the callback function. *)
+
+val download_file_if_not_exist : ?fail:exn callback -> Slave_types.source -> string -> string -> unit callback -> unit
+ (** Like {!download_file} except that if [localfile] already exists
+ then the download is skipped. You can use this to implement
+ caching of remote files. *)
+
+val file_information : ?fail:exn callback -> Slave_types.source -> string -> string callback -> unit
+ (** [file_information src pathname cb] calculates the file
+ information of the file [pathname]. *)
+
+val open_domain : ?fail:exn callback -> string -> Slave_types.inspection_data callback -> unit
+ (** [open_domain name cb] retrieves the list of block devices for
+ the libvirt domain [name], creates a libguestfs handle, adds
+ those block devices, launches the handle, and performs
+ inspection.
+
+ If this is successful, then [cb] is called in the main thread
+ with the list of filesystems and the results of inspection.