Tips for OCaml section added.
[virt-p2v.git] / virt-p2v
index 6133595..d54da3a 100755 (executable)
--- a/virt-p2v
+++ b/virt-p2v
@@ -450,34 +450,7 @@ let auto_network state =
   (* Fedora gives an error if this file doesn't exist. *)
   sh "touch /etc/resolv.conf";
 
-(*
-  (* We can run /mnt/root/etc/init.d/network in a chroot environment,
-   * however this won't work directly because the architecture of the
-   * binaries under /mnt/root (eg. /mnt/root/sbin/ip) might not match
-   * the architecture of the live CD kernel.  In particular, a 32 bit
-   * live CD cannot run 64 bit binaries.  So we also have to bind-mount
-   * the live CD's /bin, /sbin, /lib etc. over the equivalents in
-   * /mnt/root.
-   *)
-  let bind dir =
-    if is_dir dir = Some true then
-      sh ("mount -o bind " ^ quote dir ^ " " ^ quote ("/mnt/root" ^ dir))
-  in
-  let unbind dir =
-    if is_dir dir = Some true then sh ("umount -l " ^ quote ("/mnt/root" ^ dir))
-  in
-  let dirs = [
-    "/bin"; "/sbin"; "/lib"; "/lib64";
-    "/usr/bin"; "/usr/sbin"; "/usr/lib"; "/usr/lib64";
-    "/proc"; "/sys"
-  ] in
-  List.iter bind dirs;
-  let status = shwithstatus "chroot /mnt/root /etc/init.d/network start" in
-  List.iter unbind dirs;
-*)
-
-  (* Simpler way to do the above.
-   * NB. Lazy unmount is required because dhclient keeps its current
+  (* NB. Lazy unmount is required because dhclient keeps its current
    * directory open on /etc/sysconfig/network-scripts/
    *)
   sh "mount -o bind /mnt/root/etc /etc";
@@ -1491,8 +1464,8 @@ MAC address:  %s"
          let bytes_sent = Int64.add bytes_sent (Int64.of_int n) in
          let last_printed_at =
            let now = gettimeofday () in
-           (* Print progress once per second. *)
-           if now -. last_printed_at > 1. then (
+           (* Print progress every few seconds. *)
+           if now -. last_printed_at > 5. then (
              let elapsed = Int64.to_float bytes_sent /. Int64.to_float size in
              let secs_elapsed = now -. start in
              printf "%.0f%%" (100. *. elapsed);