d2e5538 libxl: implement virDomainInterfaceStats

2 files Authored by Joao Martins 8 years ago, Committed by Jim Fehlig 8 years ago,
    libxl: implement virDomainInterfaceStats
    
    Introduce support for domainInterfaceStats API call for querying
    network interface statistics. Consequently it also enables the
    use of `virsh domifstat <dom> <interface name>` command plus
    seeing the interfaces names instead of "-" when doing
    `virsh domiflist <dom>`.
    
    After successful guest creation we fill the network
    interfaces names based on domain, device id and append suffix
    if it's emulated in the following form: vif<domid>.<devid>[-emu].
    We extract the network interfaces info from the libxl_domain_config
    object in libxlDomainCreateIfaceNames() to generate ifname. On domain
    cleanup we also clear ifname, in case it was set by libvirt (i.e.
    being prefixed with "vif"). We also skip these two steps in case the name
    of the interface was manually inserted by the adminstrator.
    
    For getting the interface statistics we resort to virNetInterfaceStats
    and let libvirt handle the platform specific nits. Note that the latter
    is not yet supported in FreeBSD.
    
    Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
    
        
file modified
+37 -0
file modified
+52 -0