mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
Convert virDomainVcpuPinDefCopy into virDomainPinDefCopy
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
24b15ea90d
commit
c16723f606
@ -2004,15 +2004,15 @@ virDomainClockDefClear(virDomainClockDefPtr def)
|
||||
}
|
||||
|
||||
virDomainPinDefPtr *
|
||||
virDomainVcpuPinDefCopy(virDomainPinDefPtr *src, int nvcpupin)
|
||||
virDomainPinDefCopy(virDomainPinDefPtr *src, int npin)
|
||||
{
|
||||
size_t i;
|
||||
virDomainPinDefPtr *ret = NULL;
|
||||
|
||||
if (VIR_ALLOC_N(ret, nvcpupin) < 0)
|
||||
if (VIR_ALLOC_N(ret, npin) < 0)
|
||||
goto error;
|
||||
|
||||
for (i = 0; i < nvcpupin; i++) {
|
||||
for (i = 0; i < npin; i++) {
|
||||
if (VIR_ALLOC(ret[i]) < 0)
|
||||
goto error;
|
||||
ret[i]->id = src[i]->id;
|
||||
@ -2024,7 +2024,7 @@ virDomainVcpuPinDefCopy(virDomainPinDefPtr *src, int nvcpupin)
|
||||
|
||||
error:
|
||||
if (ret) {
|
||||
for (i = 0; i < nvcpupin; i++) {
|
||||
for (i = 0; i < npin; i++) {
|
||||
if (ret[i]) {
|
||||
virBitmapFree(ret[i]->cpumask);
|
||||
VIR_FREE(ret[i]);
|
||||
|
@ -1910,8 +1910,8 @@ struct _virDomainPinDef {
|
||||
void virDomainPinDefFree(virDomainPinDefPtr def);
|
||||
void virDomainPinDefArrayFree(virDomainPinDefPtr *def, int npin);
|
||||
|
||||
virDomainPinDefPtr *virDomainVcpuPinDefCopy(virDomainPinDefPtr *src,
|
||||
int nvcpupin);
|
||||
virDomainPinDefPtr *virDomainPinDefCopy(virDomainPinDefPtr *src,
|
||||
int npin);
|
||||
|
||||
int virDomainVcpuPinIsDuplicate(virDomainPinDefPtr *def,
|
||||
int nvcpupin,
|
||||
|
@ -385,6 +385,7 @@ virDomainParseMemory;
|
||||
virDomainPausedReasonTypeFromString;
|
||||
virDomainPausedReasonTypeToString;
|
||||
virDomainPinDefArrayFree;
|
||||
virDomainPinDefCopy;
|
||||
virDomainPinDefFree;
|
||||
virDomainPMSuspendedReasonTypeFromString;
|
||||
virDomainPMSuspendedReasonTypeToString;
|
||||
@ -438,7 +439,6 @@ virDomainTPMDefFree;
|
||||
virDomainTPMModelTypeFromString;
|
||||
virDomainTPMModelTypeToString;
|
||||
virDomainVcpuPinAdd;
|
||||
virDomainVcpuPinDefCopy;
|
||||
virDomainVcpuPinDel;
|
||||
virDomainVcpuPinFindByVcpu;
|
||||
virDomainVcpuPinIsDuplicate;
|
||||
|
@ -5111,8 +5111,8 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
|
||||
}
|
||||
|
||||
if (vm->def->cputune.vcpupin) {
|
||||
newVcpuPin = virDomainVcpuPinDefCopy(vm->def->cputune.vcpupin,
|
||||
vm->def->cputune.nvcpupin);
|
||||
newVcpuPin = virDomainPinDefCopy(vm->def->cputune.vcpupin,
|
||||
vm->def->cputune.nvcpupin);
|
||||
if (!newVcpuPin)
|
||||
goto endjob;
|
||||
|
||||
@ -5984,10 +5984,9 @@ qemuDomainPinIOThread(virDomainPtr dom,
|
||||
}
|
||||
|
||||
if (vm->def->cputune.iothreadspin) {
|
||||
/* The VcpuPinDefCopy works for IOThreads too */
|
||||
newIOThreadsPin =
|
||||
virDomainVcpuPinDefCopy(vm->def->cputune.iothreadspin,
|
||||
vm->def->cputune.niothreadspin);
|
||||
virDomainPinDefCopy(vm->def->cputune.iothreadspin,
|
||||
vm->def->cputune.niothreadspin);
|
||||
if (!newIOThreadsPin)
|
||||
goto endjob;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user