118b240 network: only clear bandwidth if it has been set

Authored and Committed by Laine Stump 9 years ago
    network: only clear bandwidth if it has been set
    
    libvirt was unconditionally calling virNetDevBandwidthClear() for
    every interface (and network bridge) of a type that supported
    bandwidth, whether it actually had anything set or not. This doesn't
    hurt anything (unless ifname == NULL!), but is wasteful.
    
    This patch makes sure that all calls to virNetDevBandwidthClear() are
    qualified by checking that the interface really had some bandwidth
    setup done, and checks for a null ifname inside
    virNetDevBandwidthClear(), silently returning success if it is null
    (as well as removing the ATTRIBUTE_NONNULL from that function's
    prototype, since we can't guarantee that it is never null,
    e.g. sometimes a type='ethernet' interface has no ifname as it is
    provided on the fly by qemu).
    
        
file modified
+2 -1
file modified
+4 -2
file modified
+3 -2