On Mon, Mar 03, 2008 at 11:31:10AM +0530, Ajishrao.r wrote: > Hi, > I am trying to use libvirt, any one please help more about > virDomainBlockStats, virDomainInterfaceStats and virNodeGetCellsFreeMemory > any pointer or docs? Is there anything in particular you want to know? If you want to see virDomainBlockStats and virDomainInterfaceStats in action I suggest getting virt-top which makes use of these calls: http://et.redhat.com/~rjones/virt-top/ (It's also in Fedora). If you run virt-top with a recent version of libvirt and export LIBVIRT_DEBUG=1 then it will show you the libvirt calls being made. Basically what you do is call virDomainGetXMLDesc for a domain, parse out the <target dev="foo"> for each block device and network interface, and then pass that string ("foo") back to virDomainBlockStats or virDomainInterfaceStats as the path parameter. If the call is supported by the hypervisor then what you get back is a structure with the stats you requested. For reasons of efficiency you probably don't want to call virDomainGetXMLDesc frequently. You only need to call it when the domain's devices change, and for most programs you can ignore that possibility and just call it once per domain. All of the stats monotonically increment, so you need to do your own subtraction and divide by the time between calls in order to get rates. Again, see the code in virt-top. We expose all the stats as 64 bit counters so hopefully they don't wrap for a Very Long Time, but in some cases the underlying kernel or hypervisor is using 32 bit counters (particularly Linux's /proc/net/dev with a 32 bit kernel IIRC) so be careful about that. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list