提交 feb69a19 编写于 作者: J Ján Tomko

conf: do not pass vm object to virDomainClearNetBandwidth

This function only uses the domain definition.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 1b6d56a3
......@@ -285,16 +285,16 @@ virNetDevBandwidthFormat(const virNetDevBandwidth *def,
}
void
virDomainClearNetBandwidth(virDomainObjPtr vm)
virDomainClearNetBandwidth(virDomainDefPtr def)
{
size_t i;
virDomainNetType type;
for (i = 0; i < vm->def->nnets; i++) {
type = virDomainNetGetActualType(vm->def->nets[i]);
if (virDomainNetGetActualBandwidth(vm->def->nets[i]) &&
for (i = 0; i < def->nnets; i++) {
type = virDomainNetGetActualType(def->nets[i]);
if (virDomainNetGetActualBandwidth(def->nets[i]) &&
virNetDevSupportsBandwidth(type))
virNetDevBandwidthClear(vm->def->nets[i]->ifname);
virNetDevBandwidthClear(def->nets[i]->ifname);
}
}
......
......@@ -34,7 +34,7 @@ int virNetDevBandwidthFormat(const virNetDevBandwidth *def,
unsigned int class_id,
virBufferPtr buf);
void virDomainClearNetBandwidth(virDomainObjPtr vm)
void virDomainClearNetBandwidth(virDomainDefPtr def)
ATTRIBUTE_NONNULL(1);
bool virNetDevSupportsBandwidth(virDomainNetType type);
......
......@@ -7349,7 +7349,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
}
/* Clear network bandwidth */
virDomainClearNetBandwidth(vm);
virDomainClearNetBandwidth(vm->def);
virDomainConfVMNWFilterTeardown(vm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册