提交 98eabee0 编写于 作者: M Michal Privoznik

qemuDomainInterfaceStats: Check for the actual type of interface

Users might have configured interface so that it's type of
network, but the corresponding network plugs interfaces into an
OVS bridge. Therefore, we have to check for the actual type of
the interface instead of the configured one.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 d4588bb9
......@@ -11045,7 +11045,7 @@ qemuDomainInterfaceStats(virDomainPtr dom,
goto cleanup;
}
if (net->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
if (virNetDevOpenvswitchInterfaceStats(path, stats) < 0)
goto cleanup;
} else {
......@@ -19568,15 +19568,19 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
/* Check the path is one of the domain's network interfaces. */
for (i = 0; i < dom->def->nnets; i++) {
virDomainNetType actualType;
if (!dom->def->nets[i]->ifname)
continue;
memset(&tmp, 0, sizeof(tmp));
actualType = virDomainNetGetActualType(dom->def->nets[i]);
QEMU_ADD_NAME_PARAM(record, maxparams,
"net", "name", i, dom->def->nets[i]->ifname);
if (dom->def->nets[i]->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
if (actualType == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
if (virNetDevOpenvswitchInterfaceStats(dom->def->nets[i]->ifname,
&tmp) < 0) {
virResetLastError();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册