mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
virDomainInterfaceStats: Accept MAC addresses properly
https://bugzilla.redhat.com/show_bug.cgi?id=1497396
In 0d3d020ba6
I've added capability to accept MAC addresses
for the API too. However, the implementation was faulty. It needs
to lookup the corresponding interface in the domain definition
and pass the ifname instead of MAC address.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
ac7cc62419
commit
be9978bb89
@ -4982,7 +4982,7 @@ libxlDomainInterfaceStats(virDomainPtr dom,
|
||||
if (!(net = virDomainNetFind(vm->def, device)))
|
||||
goto endjob;
|
||||
|
||||
if (virNetDevTapInterfaceStats(device, stats,
|
||||
if (virNetDevTapInterfaceStats(net->ifname, stats,
|
||||
!virDomainNetTypeSharesHostView(net)) < 0)
|
||||
goto endjob;
|
||||
|
||||
|
@ -2875,7 +2875,7 @@ lxcDomainInterfaceStats(virDomainPtr dom,
|
||||
if (!(net = virDomainNetFind(vm->def, device)))
|
||||
goto endjob;
|
||||
|
||||
if (virNetDevTapInterfaceStats(device, stats,
|
||||
if (virNetDevTapInterfaceStats(net->ifname, stats,
|
||||
!virDomainNetTypeSharesHostView(net)) < 0)
|
||||
goto endjob;
|
||||
|
||||
|
@ -2009,7 +2009,7 @@ openvzDomainInterfaceStats(virDomainPtr dom,
|
||||
if (!(net = virDomainNetFind(vm->def, device)))
|
||||
goto cleanup;
|
||||
|
||||
if (virNetDevTapInterfaceStats(device, stats,
|
||||
if (virNetDevTapInterfaceStats(net->ifname, stats,
|
||||
!virDomainNetTypeSharesHostView(net)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -11044,10 +11044,10 @@ qemuDomainInterfaceStats(virDomainPtr dom,
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
|
||||
if (virNetDevOpenvswitchInterfaceStats(device, stats) < 0)
|
||||
if (virNetDevOpenvswitchInterfaceStats(net->ifname, stats) < 0)
|
||||
goto cleanup;
|
||||
} else {
|
||||
if (virNetDevTapInterfaceStats(device, stats,
|
||||
if (virNetDevTapInterfaceStats(net->ifname, stats,
|
||||
!virDomainNetTypeSharesHostView(net)) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user