mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
Replace virDomainVcpuPinAdd with virDomainPinAdd
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
a8a89270ef
commit
cacf27f212
@ -16772,47 +16772,45 @@ virDomainPinFind(virDomainPinDefPtr *def,
|
||||
}
|
||||
|
||||
int
|
||||
virDomainVcpuPinAdd(virDomainPinDefPtr **vcpupin_list,
|
||||
size_t *nvcpupin,
|
||||
unsigned char *cpumap,
|
||||
int maplen,
|
||||
int vcpu)
|
||||
virDomainPinAdd(virDomainPinDefPtr **pindef_list,
|
||||
size_t *npin,
|
||||
unsigned char *cpumap,
|
||||
int maplen,
|
||||
int id)
|
||||
{
|
||||
virDomainPinDefPtr vcpupin = NULL;
|
||||
virDomainPinDefPtr pindef = NULL;
|
||||
|
||||
if (!vcpupin_list)
|
||||
if (!pindef_list)
|
||||
return -1;
|
||||
|
||||
vcpupin = virDomainPinFind(*vcpupin_list,
|
||||
*nvcpupin,
|
||||
vcpu);
|
||||
if (vcpupin) {
|
||||
vcpupin->id = vcpu;
|
||||
virBitmapFree(vcpupin->cpumask);
|
||||
vcpupin->cpumask = virBitmapNewData(cpumap, maplen);
|
||||
if (!vcpupin->cpumask)
|
||||
pindef = virDomainPinFind(*pindef_list, *npin, id);
|
||||
if (pindef) {
|
||||
pindef->id = id;
|
||||
virBitmapFree(pindef->cpumask);
|
||||
pindef->cpumask = virBitmapNewData(cpumap, maplen);
|
||||
if (!pindef->cpumask)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* No existing vcpupin matches vcpu, adding a new one */
|
||||
/* No existing pindef matches id, adding a new one */
|
||||
|
||||
if (VIR_ALLOC(vcpupin) < 0)
|
||||
if (VIR_ALLOC(pindef) < 0)
|
||||
goto error;
|
||||
|
||||
vcpupin->id = vcpu;
|
||||
vcpupin->cpumask = virBitmapNewData(cpumap, maplen);
|
||||
if (!vcpupin->cpumask)
|
||||
pindef->id = id;
|
||||
pindef->cpumask = virBitmapNewData(cpumap, maplen);
|
||||
if (!pindef->cpumask)
|
||||
goto error;
|
||||
|
||||
if (VIR_APPEND_ELEMENT(*vcpupin_list, *nvcpupin, vcpupin) < 0)
|
||||
if (VIR_APPEND_ELEMENT(*pindef_list, *npin, pindef) < 0)
|
||||
goto error;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virDomainPinDefFree(vcpupin);
|
||||
virDomainPinDefFree(pindef);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2557,11 +2557,11 @@ int virDomainDefCompatibleDevice(virDomainDefPtr def,
|
||||
virDomainDeviceDefPtr dev,
|
||||
virDomainDeviceAction action);
|
||||
|
||||
int virDomainVcpuPinAdd(virDomainPinDefPtr **vcpupin_list,
|
||||
size_t *nvcpupin,
|
||||
unsigned char *cpumap,
|
||||
int maplen,
|
||||
int vcpu);
|
||||
int virDomainPinAdd(virDomainPinDefPtr **pindef_list,
|
||||
size_t *npin,
|
||||
unsigned char *cpumap,
|
||||
int maplen,
|
||||
int id);
|
||||
|
||||
void virDomainVcpuPinDel(virDomainDefPtr def, int vcpu);
|
||||
|
||||
|
@ -384,6 +384,7 @@ virDomainObjTaint;
|
||||
virDomainParseMemory;
|
||||
virDomainPausedReasonTypeFromString;
|
||||
virDomainPausedReasonTypeToString;
|
||||
virDomainPinAdd;
|
||||
virDomainPinDefArrayFree;
|
||||
virDomainPinDefCopy;
|
||||
virDomainPinDefFree;
|
||||
@ -440,7 +441,6 @@ virDomainTPMBackendTypeToString;
|
||||
virDomainTPMDefFree;
|
||||
virDomainTPMModelTypeFromString;
|
||||
virDomainTPMModelTypeToString;
|
||||
virDomainVcpuPinAdd;
|
||||
virDomainVcpuPinDel;
|
||||
virDomainVideoDefaultRAM;
|
||||
virDomainVideoDefaultType;
|
||||
|
@ -1999,11 +1999,11 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu,
|
||||
goto endjob;
|
||||
targetDef->cputune.nvcpupin = 0;
|
||||
}
|
||||
if (virDomainVcpuPinAdd(&targetDef->cputune.vcpupin,
|
||||
&targetDef->cputune.nvcpupin,
|
||||
cpumap,
|
||||
maplen,
|
||||
vcpu) < 0) {
|
||||
if (virDomainPinAdd(&targetDef->cputune.vcpupin,
|
||||
&targetDef->cputune.nvcpupin,
|
||||
cpumap,
|
||||
maplen,
|
||||
vcpu) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("failed to update or add vcpupin xml"));
|
||||
goto endjob;
|
||||
|
@ -5123,8 +5123,8 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
|
||||
newVcpuPinNum = 0;
|
||||
}
|
||||
|
||||
if (virDomainVcpuPinAdd(&newVcpuPin, &newVcpuPinNum,
|
||||
cpumap, maplen, vcpu) < 0) {
|
||||
if (virDomainPinAdd(&newVcpuPin, &newVcpuPinNum,
|
||||
cpumap, maplen, vcpu) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("failed to update vcpupin"));
|
||||
goto endjob;
|
||||
@ -5188,11 +5188,11 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
|
||||
goto endjob;
|
||||
persistentDef->cputune.nvcpupin = 0;
|
||||
}
|
||||
if (virDomainVcpuPinAdd(&persistentDef->cputune.vcpupin,
|
||||
&persistentDef->cputune.nvcpupin,
|
||||
cpumap,
|
||||
maplen,
|
||||
vcpu) < 0) {
|
||||
if (virDomainPinAdd(&persistentDef->cputune.vcpupin,
|
||||
&persistentDef->cputune.nvcpupin,
|
||||
cpumap,
|
||||
maplen,
|
||||
vcpu) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("failed to update or add vcpupin xml of "
|
||||
"a persistent domain"));
|
||||
@ -5400,7 +5400,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
|
||||
if (VIR_ALLOC(newVcpuPin) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (virDomainVcpuPinAdd(&newVcpuPin, &newVcpuPinNum, cpumap, maplen, -1) < 0) {
|
||||
if (virDomainPinAdd(&newVcpuPin, &newVcpuPinNum, cpumap, maplen, -1) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("failed to update vcpupin"));
|
||||
virDomainPinDefArrayFree(newVcpuPin, newVcpuPinNum);
|
||||
|
@ -1897,11 +1897,11 @@ xenDaemonDomainPinVcpu(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
def->cputune.nvcpupin = 0;
|
||||
}
|
||||
if (virDomainVcpuPinAdd(&def->cputune.vcpupin,
|
||||
&def->cputune.nvcpupin,
|
||||
cpumap,
|
||||
maplen,
|
||||
vcpu) < 0) {
|
||||
if (virDomainPinAdd(&def->cputune.vcpupin,
|
||||
&def->cputune.nvcpupin,
|
||||
cpumap,
|
||||
maplen,
|
||||
vcpu) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("failed to add vcpupin xml entry"));
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user