[libvirt] I need help for use virDomainInterfaceStats

Hi I want use the virDomainInterfaceStats for get statistic of domain, but I don't now how get path parametr. Please help me! Thanks.

On 02/22/2011 10:12 AM, Фёдор Пранович wrote:
Hi I want use the virDomainInterfaceStats for get statistic of domain, but I don't now how get path parametr. Please help me!
The path argument in virDomainInterfaceStats() is intended to be the name of the tap interface on the host that's used to connect the guest to the network, eg "vnet0". You can find this name by retrieving the XML for the active domain, and looking for <target dev='xxx'/> in each <interface> element - the 'xxx' is the tap interface name, and should be put in the path arg when calling virDomainInterfaceStats().

On 02.04.2012 20:56, siddharth wrote:
Фёдор Пранович <pr.fedor <at> gmail.com> writes:
Hi I want use the virDomainInterfaceStats for get statistic of domain, but I don't now how get path parametr. Please help me! Thanks.
Please Help me Too !!
Basically, it's string(/domain/devices/interface[n]/target/@dev) where n is index of the interface you wanna get statistics for. For example, if I have this in XML (virDomainGetXMLDesc()): ... <interface type='network'> <mac address='52:54:00:57:f5:50'/> <source network='default'/> <target dev='vnet0'/> <model type='virtio'/> <filterref filter='no-ip-spoofing'> <parameter name='ip_learning' value='dhcp'/> </filterref> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <interface type='direct'> <mac address='52:54:00:16:e6:5c'/> <source dev='eth0' mode='bridge'/> <target dev='macvtap0'/> <model type='virtio'/> <alias name='net1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </interface> ... I would query for stats: virDomainInterfaceStats(dom, "vnet0", ...); virDomainInterfaceStats(dom, "macvtap0", ...); Michal
participants (4)
-
Laine Stump
-
Michal Privoznik
-
siddharth
-
Фёдор Пранович