[Libvir] [PATCH 1/2] KVM network stats

Richard W.M. Jones rjones at redhat.com
Thu Nov 15 15:53:00 UTC 2007

Firstly there's a bug in how we parse /proc/net/dev.  The format of each 
interface line turns out to be:


so in other words network interface names smaller than 6 characters are 
right justified (padded on the left with spaces).

This isn't a problem for Xen because the shortest interface name (eg. 
'vif1.0') is always 6 or more characters long.  However it is a problem 
for QEMU and KVM because we have interface names such as 'vnet0'.

In any case, the following patch fixes this bug.


Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-kvm-net-stats-1of2.patch
Type: text/x-patch
Size: 1586 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20071115/0583b0e5/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20071115/0583b0e5/attachment-0003.bin>

More information about the libvir-list mailing list