mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
1b6d56a39e
commit
feb69a19ac
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue