<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><b>Just to clarify my problems:</b></div>For each KVM virtual machine, it is actually a process running on the host. <div>The $pid in "/proc/$pid/io" represents the VM process’s PID. All my work</div><div>is done on the host, not inside the VMs.  Take the VM process’s pid is “pid”, </div><div>What the /proc/$pid/io records is io statistics of the VM from the host’s </div><div>perspective. I understand that qemu might do some I/O coalescing kind of</div><div>work, but /proc/$pid/io reveals the actual IOs submitted to the host kernel.</div><div><br></div><div>For example, through “ps” command, i get the following info of one of my </div><div>VMs: (the pid of the VM process is 4438)</div><div><br></div><div>qemu      <font color="#b51a00">4438</font>     1  0 Jun24 ?        00:06:25 /usr/bin/qemu-system-x86_64 ...</div><div><div><br></div><div><font color="#0056d6">[unrelevant data fields are ignored]</font></div><div>Command line "<i>virsh domblkstat $vmname vda</i>” get the results below:</div><div><div><span class="Apple-tab-span" style="white-space:pre">  </span>vda rd_bytes 639415808</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>vda wr_bytes 728186880</div></div><div><br></div><div>Command line "<i>cat /proc/4438/io</i>” get the result below:</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>read_bytes: 772415488 </div><div><span class="Apple-tab-span" style="white-space:pre">  </span>write_bytes: 734040064</div><div><br></div><div>I execute the above two commands consecutively using “&&", but we can </div><div>that the results vary a lot, especially for the read_bytes. </div><div><br></div><div>Since libvirt virDomainBlockStats API reads data from qemu  i should ask</div><div>the qemu folks for the answers. Great thanks, anyway.</div><div><br></div><div><br></div><div><br><div><div>On Jun 25, 2014, at 3:45 AM, Eric Blake <<a href="mailto:eblake@redhat.com">eblake@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On 06/24/2014 02:24 AM, coperd wrote:<br><br><blockquote type="cite"><br>It is supposed that the VM’s disk “rd_bytes" and “wr_bytes" should<br></blockquote>never exceed the value of the physical disk respectively, right ?<br><br>That's a question for the qemu folks.<br><br><blockquote type="cite">Doesn’t<br>libvirt virDomainBlockStats read disk information from “proc” ?<br></blockquote><br>No, libvirt reads it from the qemu QMP command query-blockstats.  Beyond<br>that, you'll have to investigate how qemu comes up with that number.<br><br><br>-- <br>Eric Blake   eblake redhat com    +1-919-301-3266<br>Libvirt virtualization library <a href="http://libvirt.org">http://libvirt.org</a><br><br></blockquote></div><br></div></div></body></html>