Switch to using new event API.
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 7 Apr 2011 10:14:39 +0000 (11:14 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 7 Apr 2011 10:16:20 +0000 (11:16 +0100)
NB: This requires libguestfs >= 1.9.11.  It is not compatible
with earlier versions.

guestfs-browser.spec.in
slave.ml

index a4f69e3..d1ac91e 100644 (file)
@@ -12,7 +12,7 @@ Source0:        http://people.redhat.com/~rjones/guestfs-browser/files/guestfs-b
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  hivex-devel >= 1.2.4-3
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  hivex-devel >= 1.2.4-3
-BuildRequires:  libguestfs-devel >= 1.7.24
+BuildRequires:  libguestfs-devel >= 1.9.11
 BuildRequires:  libvirt-devel
 BuildRequires:  ocaml
 BuildRequires:  ocaml-bitstring-devel
 BuildRequires:  libvirt-devel
 BuildRequires:  ocaml
 BuildRequires:  ocaml-bitstring-devel
@@ -28,7 +28,7 @@ BuildRequires:  ocaml-xml-light-devel
 BuildRequires:  /usr/bin/pod2man
 BuildRequires:  /usr/bin/pod2html
 
 BuildRequires:  /usr/bin/pod2man
 BuildRequires:  /usr/bin/pod2html
 
-Requires:       libguestfs >= 1.7.24
+Requires:       libguestfs >= 1.9.11
 Requires:       /usr/bin/gnome-open
 Requires:       /usr/bin/hivexregedit
 
 Requires:       /usr/bin/gnome-open
 Requires:       /usr/bin/hivexregedit
 
index 7fcfb08..c12f9a3 100644 (file)
--- a/slave.ml
+++ b/slave.ml
@@ -1,5 +1,5 @@
 (* Guestfs Browser.
 (* Guestfs Browser.
- * Copyright (C) 2010 Red Hat Inc.
+ * Copyright (C) 2010-2011 Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -488,11 +488,19 @@ and open_disk_images images cb =
   (* g#set_verbose (verbose ());*)
 
   (* Attach progress bar callback. *)
   (* g#set_verbose (verbose ());*)
 
   (* Attach progress bar callback. *)
-  g#set_progress_callback (
-    fun proc_nr serial position total ->
-      debug "progress callback proc_nr=%d serial=%d posn=%Ld total=%Ld"
-        proc_nr serial position total;
-      GtkThread.async !progress_hook (position, total)
+  ignore (
+    g#set_event_callback (
+      fun g event handle buf array ->
+        if event == G.EVENT_PROGRESS && Array.length array == 4 then (
+          let proc_nr = array.(0)
+          and serial = array.(1)
+          and position = array.(2)
+          and total = array.(3) in
+          debug "progress callback proc_nr=%Ld serial=%Ld posn=%Ld total=%Ld"
+            proc_nr serial position total;
+          GtkThread.async !progress_hook (position, total)
+        )
+    ) [ G.EVENT_PROGRESS ]
   );
 
   List.iter (
   );
 
   List.iter (