<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">D&#328;a 18.03.2014 13:24, Federico Alberto
      Sayd wrote / nap&iacute;sal(a):<br>
    </div>
    <blockquote cite="mid:53283AF4.1050500@uncu.edu.ar" type="cite">On
      24/02/14 13:59, Itamar Heim wrote:
      <br>
      <blockquote type="cite">with oVirt 3.4 getting close to GA with
        many many great features, time to collect requests for 3.5...
        <br>
        <br>
      </blockquote>
      Add progress bar to task tab to indicate the progress percent of
      snapshot creation, vm clonation, migration, etc.
      <br>
    </blockquote>
    <br>
    I needed this a long time ago, so i hacked this together. You shoud
    run it on the SPM host. Also, i only use iscsi storage.<br>
    <br>
    <tt><br>
    </tt><tt>#!/bin/bash</tt><tt><br>
    </tt><tt><br>
    </tt><tt>SECS=1</tt><tt><br>
    </tt><tt>PROC=${1:-"qemu-img"}</tt><tt><br>
    </tt><tt>PID=`pidof $PROC`</tt><tt><br>
    </tt><tt><br>
    </tt><tt>if [ "x$PID" == "x" ]</tt><tt><br>
    </tt><tt>then</tt><tt><br>
    </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "No $PROC running"</tt><tt><br>
    </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit 1</tt><tt><br>
    </tt><tt>fi</tt><tt><br>
    </tt><tt><br>
    </tt><tt>LV=$(ls -l /dev/mapper/ | grep `ls -l /proc/$PID/fd/|grep
      dm- | cut -f 3 -d/ | head -n1` | gawk '{print $9}' | sed -e
      's/--/XX/g' -e 's/-/\//g' -e 's/XX/-/g' -e 's/^/\/dev\//g')</tt><tt><br>
    </tt><tt><br>
    </tt><tt>SIZE=$(/sbin/lvs --noheadings --unquoted --options lv_size
      --units b $LV | sed -e 's/B//g' )</tt><tt><br>
    </tt><tt><br>
    </tt><tt>LAST=0</tt><tt><br>
    </tt><tt>while [[ -e /proc/$PID/fd/ ]] ;</tt><tt><br>
    </tt><tt>do</tt><tt><br>
    </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CUR=$(grep rchar /proc/$PID/io | cut -f 2 -d " ")</tt><tt><br>
    </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PERC=$(echo $CUR*100/$SIZE | bc)</tt><tt><br>
    </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SPEED=$(echo \($CUR-$LAST\)/1024/1024 | bc)</tt><tt><br>
    </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIZE2=$(echo $SIZE / 1024 / 1024 / 1024| bc)</tt><tt><br>
    </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "$SIZE2 GB / $CUR B [$PERC%] - $SPEED MB/s"</tt><tt><br>
    </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep $SECS;</tt><tt><br>
    </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LAST=$CUR</tt><tt><br>
    </tt><tt>done</tt><br>
    <br>
    <div class="moz-signature">-- <br>
      <div id="oernii_footer" style="color: gray;">
        <span style="font-family: Lucida Console, Luxi Mono, Courier,
          monospace; font-size: 90%;">
          Ernest Beinrohr, AXON PRO<br>
          <a style="text-decoration: none; color: gray;"
            href="http://www.beinrohr.sk/ing.php">Ing</a>, <a
            style="text-decoration: none; color: gray;"
            href="http://www.beinrohr.sk/rhce.php">RHCE</a>, <a
            style="text-decoration: none; color: gray;"
            href="http://www.beinrohr.sk/rhce.php">RHCVA</a>, <a
            style="text-decoration: none; color: gray;"
            href="http://www.beinrohr.sk/lpic.php">LPIC</a>, <a
            style="text-decoration: none; color: gray;"
            href="http://www.beinrohr.sk/vca.php">VCA</a>, <a
            style="text-decoration: none; color: gray;"
            href="callto://+421-2--6241-0360">+421-2--6241-0360</a>, <a
            style="text-decoration: none; color: gray;"
            href="callto://+421-903--482-603">+421-903--482-603</a><br>
          icq:28153343, gtalk: <a class="moz-txt-link-abbreviated" href="mailto:oernii@axonpro.sk">oernii@axonpro.sk</a>,
          <a class="moz-txt-link-abbreviated" href="mailto:jabber:oernii@jabber.org">jabber:oernii@jabber.org</a>
          <br>
        </span>
        <hr style="height: 1px; width: 95%"> <span style="font-size:
          70%;">
          &#8220;For a successful technology, reality must take precedence
          over public relations, for Nature cannot be fooled.&#8221; Richard
          Feynman </span> </div>
    </div>
    <img
      src="http://nojsstats.appspot.com/UA-44497096-1/email.beinrohr.sk"
      moz-do-not-send="true" border="0" width="1" height="1">
  </body>
</html>