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