提交 be9978bb 编写于 作者: M Michal Privoznik

virDomainInterfaceStats: Accept MAC addresses properly

https://bugzilla.redhat.com/show_bug.cgi?id=1497396

In 0d3d020b 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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 ac7cc624
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册