mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
Convert virDomainVcpuPinDefArrayFree to virDomainPinDefArrayFree
Since both Vcpu and IOThreads code use the same API's, alter the naming of the API's to remove the "Vcpu" specific reference
This commit is contained in:
parent
0a06a1812d
commit
24b15ea90d
@ -2046,15 +2046,15 @@ virDomainPinDefFree(virDomainPinDefPtr def)
|
||||
}
|
||||
|
||||
void
|
||||
virDomainVcpuPinDefArrayFree(virDomainPinDefPtr *def,
|
||||
int nvcpupin)
|
||||
virDomainPinDefArrayFree(virDomainPinDefPtr *def,
|
||||
int npin)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!def)
|
||||
return;
|
||||
|
||||
for (i = 0; i < nvcpupin; i++)
|
||||
for (i = 0; i < npin; i++)
|
||||
virDomainPinDefFree(def[i]);
|
||||
|
||||
VIR_FREE(def);
|
||||
@ -2229,11 +2229,11 @@ void virDomainDefFree(virDomainDefPtr def)
|
||||
|
||||
virCPUDefFree(def->cpu);
|
||||
|
||||
virDomainVcpuPinDefArrayFree(def->cputune.vcpupin, def->cputune.nvcpupin);
|
||||
virDomainPinDefArrayFree(def->cputune.vcpupin, def->cputune.nvcpupin);
|
||||
|
||||
virDomainPinDefFree(def->cputune.emulatorpin);
|
||||
|
||||
virDomainVcpuPinDefArrayFree(def->cputune.iothreadspin,
|
||||
virDomainPinDefArrayFree(def->cputune.iothreadspin,
|
||||
def->cputune.niothreadspin);
|
||||
|
||||
for (i = 0; i < def->cputune.nvcpusched; i++)
|
||||
|
@ -1908,7 +1908,7 @@ struct _virDomainPinDef {
|
||||
};
|
||||
|
||||
void virDomainPinDefFree(virDomainPinDefPtr def);
|
||||
void virDomainVcpuPinDefArrayFree(virDomainPinDefPtr *def, int nvcpupin);
|
||||
void virDomainPinDefArrayFree(virDomainPinDefPtr *def, int npin);
|
||||
|
||||
virDomainPinDefPtr *virDomainVcpuPinDefCopy(virDomainPinDefPtr *src,
|
||||
int nvcpupin);
|
||||
|
@ -384,6 +384,7 @@ virDomainObjTaint;
|
||||
virDomainParseMemory;
|
||||
virDomainPausedReasonTypeFromString;
|
||||
virDomainPausedReasonTypeToString;
|
||||
virDomainPinDefArrayFree;
|
||||
virDomainPinDefFree;
|
||||
virDomainPMSuspendedReasonTypeFromString;
|
||||
virDomainPMSuspendedReasonTypeToString;
|
||||
@ -437,7 +438,6 @@ virDomainTPMDefFree;
|
||||
virDomainTPMModelTypeFromString;
|
||||
virDomainTPMModelTypeToString;
|
||||
virDomainVcpuPinAdd;
|
||||
virDomainVcpuPinDefArrayFree;
|
||||
virDomainVcpuPinDefCopy;
|
||||
virDomainVcpuPinDel;
|
||||
virDomainVcpuPinFindByVcpu;
|
||||
|
@ -5154,8 +5154,8 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
|
||||
virDomainVcpuPinDel(vm->def, vcpu);
|
||||
} else {
|
||||
if (vm->def->cputune.vcpupin)
|
||||
virDomainVcpuPinDefArrayFree(vm->def->cputune.vcpupin,
|
||||
vm->def->cputune.nvcpupin);
|
||||
virDomainPinDefArrayFree(vm->def->cputune.vcpupin,
|
||||
vm->def->cputune.nvcpupin);
|
||||
|
||||
vm->def->cputune.vcpupin = newVcpuPin;
|
||||
vm->def->cputune.nvcpupin = newVcpuPinNum;
|
||||
@ -5211,7 +5211,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
|
||||
|
||||
cleanup:
|
||||
if (newVcpuPin)
|
||||
virDomainVcpuPinDefArrayFree(newVcpuPin, newVcpuPinNum);
|
||||
virDomainPinDefArrayFree(newVcpuPin, newVcpuPinNum);
|
||||
if (cgroup_vcpu)
|
||||
virCgroupFree(&cgroup_vcpu);
|
||||
qemuDomObjEndAPI(&vm);
|
||||
@ -5403,7 +5403,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
|
||||
if (virDomainVcpuPinAdd(&newVcpuPin, &newVcpuPinNum, cpumap, maplen, -1) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("failed to update vcpupin"));
|
||||
virDomainVcpuPinDefArrayFree(newVcpuPin, newVcpuPinNum);
|
||||
virDomainPinDefArrayFree(newVcpuPin, newVcpuPinNum);
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -5444,7 +5444,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
|
||||
}
|
||||
|
||||
if (newVcpuPin)
|
||||
virDomainVcpuPinDefArrayFree(newVcpuPin, newVcpuPinNum);
|
||||
virDomainPinDefArrayFree(newVcpuPin, newVcpuPinNum);
|
||||
} else {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("cpu affinity is not supported"));
|
||||
@ -6031,8 +6031,8 @@ qemuDomainPinIOThread(virDomainPtr dom,
|
||||
}
|
||||
|
||||
if (vm->def->cputune.iothreadspin)
|
||||
virDomainVcpuPinDefArrayFree(vm->def->cputune.iothreadspin,
|
||||
vm->def->cputune.niothreadspin);
|
||||
virDomainPinDefArrayFree(vm->def->cputune.iothreadspin,
|
||||
vm->def->cputune.niothreadspin);
|
||||
|
||||
vm->def->cputune.iothreadspin = newIOThreadsPin;
|
||||
vm->def->cputune.niothreadspin = newIOThreadsPinNum;
|
||||
@ -6092,7 +6092,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
|
||||
|
||||
cleanup:
|
||||
if (newIOThreadsPin)
|
||||
virDomainVcpuPinDefArrayFree(newIOThreadsPin, newIOThreadsPinNum);
|
||||
virDomainPinDefArrayFree(newIOThreadsPin, newIOThreadsPinNum);
|
||||
if (cgroup_iothread)
|
||||
virCgroupFree(&cgroup_iothread);
|
||||
if (event)
|
||||
|
Loading…
Reference in New Issue
Block a user