<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'>Nice !<br><br><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">
  
    
  
  
    <div class="moz-cite-prefix">Dňa 18.03.2014 13:24, Federico Alberto
      Sayd wrote / napísal(a):<br>
    </div>
    <blockquote cite="mid:53283AF4.1050500@uncu.edu.ar">On
      24/02/14 13:59, Itamar Heim wrote:
      <br>
      <blockquote>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" target="_blank">Ing</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php" target="_blank">RHCE</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php" target="_blank">RHCVA</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/lpic.php" target="_blank">LPIC</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/vca.php" target="_blank">VCA</a>, <a style="text-decoration: none; color: gray;" href="callto://+421-2--6241-0360" target="_blank">+421-2--6241-0360</a>, <a style="text-decoration: none; color: gray;" href="callto://+421-903--482-603" target="_blank">+421-903--482-603</a><br>
          icq:28153343, gtalk: <a class="moz-txt-link-abbreviated" href="mailto:oernii@axonpro.sk" target="_blank">oernii@axonpro.sk</a>,
          <a class="moz-txt-link-abbreviated" href="mailto:jabber:oernii@jabber.org" target="_blank">jabber:oernii@jabber.org</a>
          <br>
        </span>
        <hr style="height: 1px; width: 95%"> <span style="font-size:
          70%;">
          “For a successful technology, reality must take precedence
          over public relations, for Nature cannot be fooled.” Richard
          Feynman </span> </div>
    </div>
    <img border="0" width="1" height="1" src="http://nojsstats.appspot.com/UA-44497096-1/email.beinrohr.sk">
  

<br>_______________________________________________<br>Users mailing list<br>Users@ovirt.org<br>http://lists.ovirt.org/mailman/listinfo/users<br></blockquote><br></div></body></html>