open Printf
open Utils
+open Slave_types
module G = Guestfs
let combo, (model, column) = ws.vmcombo in
model#clear ();
List.iter (
- fun { Slave.dom_name = name } ->
+ fun { dom_name = name } ->
let row = model#append () in
model#set ~row ~column name
) doms
and when_opened_common ws name data =
(* Dump some of the inspection data in debug messages. *)
List.iter (fun (dev, t) -> debug "filesystem: %s: %s" dev t)
- data.Slave.insp_all_filesystems;
+ data.insp_all_filesystems;
List.iter (
- fun { Slave.insp_root = root; insp_type = typ; insp_distro = distro;
+ fun { insp_root = root; insp_type = typ; insp_distro = distro;
insp_major_version = major; insp_minor_version = minor } ->
debug "root device %s contains %s %s %d.%d" root typ distro major minor;
- ) data.Slave.insp_oses;
+ ) data.insp_oses;
Filetree.add ws.view name data
ws.throbber#set_pixbuf ws.throbber_static
let progress ws (position, total) =
- ws.progress_bar#set_fraction
- (Int64.to_float position /. Int64.to_float total)
+ if position = 0L && total = 1L then
+ ws.progress_bar#pulse ()
+ else
+ ws.progress_bar#set_fraction
+ (Int64.to_float position /. Int64.to_float total)
(* This is called in the main thread whenever a command fails in the
* slave thread. The command queue has been cleared before this is
let static = Throbber.static () in
(*let animation = Throbber.animation () in*)
let throbber =
- GMisc.image ~pixbuf:static ~packing:(hbox#pack ~from:`END) () in
+ (* Workaround for http://caml.inria.fr/mantis/view.php?id=4732 *)
+ let from = Obj.magic 3448763 (* `END *) in
+ GMisc.image ~pixbuf:static ~packing:(hbox#pack ~from) () in
vmcombo, refresh_button, throbber, static
| d::ds when d = guest -> i
| _::ds -> loop (i+1) ds
in
- let i = loop 0 (List.map (fun { Slave.dom_name = name } -> name) doms) in
+ let i = loop 0 (List.map (fun { dom_name = name } -> name) doms) in
let combo, _ = ws.vmcombo in
combo#set_active i