conf: do not pass vm object to virDomainClearNetBandwidth

This function only uses the domain definition.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko 2020-02-17 18:37:25 +01:00
parent 1b6d56a39e
commit feb69a19ac
3 changed files with 7 additions and 7 deletions

View File

@ -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);
}
}

View File

@ -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);

View File

@ -7349,7 +7349,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
}
/* Clear network bandwidth */
virDomainClearNetBandwidth(vm);
virDomainClearNetBandwidth(vm->def);
virDomainConfVMNWFilterTeardown(vm);