mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
Properly free vcpupin info for unplugged CPUs
Remove the pointer from def->cputune.vcpupin after unplugging
the CPU and also free the bitmap contained in the structure
by calling virDomainVcpuPinDel instead of VIR_FREE.
Introduced by commit 0df1a79
.
This makes virDomainLookupVcpuPin redundant.
https://bugzilla.redhat.com/show_bug.cgi?id=1088165
This commit is contained in:
parent
3d5c29a17c
commit
a0a8dc695e
@ -10966,26 +10966,6 @@ virDomainVcpuPinDefParseXML(xmlNodePtr node,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the vcpupin related with the vcpu id on SUCCESS, or
|
||||
* NULL on failure.
|
||||
*/
|
||||
virDomainVcpuPinDefPtr
|
||||
virDomainLookupVcpuPin(virDomainDefPtr def,
|
||||
int vcpuid)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!def->cputune.vcpupin)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < def->cputune.nvcpupin; i++) {
|
||||
if (def->cputune.vcpupin[i]->vcpuid == vcpuid)
|
||||
return def->cputune.vcpupin[i];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
virDomainDefMaybeAddController(virDomainDefPtr def,
|
||||
|
@ -2671,9 +2671,6 @@ int virDomainObjListExport(virDomainObjListPtr doms,
|
||||
virDomainObjListFilter filter,
|
||||
unsigned int flags);
|
||||
|
||||
virDomainVcpuPinDefPtr virDomainLookupVcpuPin(virDomainDefPtr def,
|
||||
int vcpuid);
|
||||
|
||||
int
|
||||
virDomainDefMaybeAddController(virDomainDefPtr def,
|
||||
int type,
|
||||
|
@ -292,7 +292,6 @@ virDomainLifecycleTypeToString;
|
||||
virDomainLiveConfigHelperMethod;
|
||||
virDomainLockFailureTypeFromString;
|
||||
virDomainLockFailureTypeToString;
|
||||
virDomainLookupVcpuPin;
|
||||
virDomainMemballoonModelTypeFromString;
|
||||
virDomainMemballoonModelTypeToString;
|
||||
virDomainMemDumpTypeFromString;
|
||||
|
@ -4120,8 +4120,6 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
|
||||
}
|
||||
} else {
|
||||
for (i = oldvcpus - 1; i >= nvcpus; i--) {
|
||||
virDomainVcpuPinDefPtr vcpupin = NULL;
|
||||
|
||||
if (priv->cgroup) {
|
||||
if (virCgroupNewVcpu(priv->cgroup, i, false, &cgroup_vcpu) < 0)
|
||||
goto cleanup;
|
||||
@ -4132,9 +4130,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
/* Free vcpupin setting */
|
||||
if ((vcpupin = virDomainLookupVcpuPin(vm->def, i))) {
|
||||
VIR_FREE(vcpupin);
|
||||
}
|
||||
ignore_value(virDomainVcpuPinDel(vm->def, i));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user