From 24b15ea90dc2ef45222acfdf7a74ea027d289da9 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 10 Mar 2015 20:19:35 -0400 Subject: [PATCH] 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 --- src/conf/domain_conf.c | 10 +++++----- src/conf/domain_conf.h | 2 +- src/libvirt_private.syms | 2 +- src/qemu/qemu_driver.c | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f495a0900b..3fb8ea8863 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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++) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 57c36c11b5..341be5f01e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -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); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 14cf3c7d87..cbc3aea972 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -384,6 +384,7 @@ virDomainObjTaint; virDomainParseMemory; virDomainPausedReasonTypeFromString; virDomainPausedReasonTypeToString; +virDomainPinDefArrayFree; virDomainPinDefFree; virDomainPMSuspendedReasonTypeFromString; virDomainPMSuspendedReasonTypeToString; @@ -437,7 +438,6 @@ virDomainTPMDefFree; virDomainTPMModelTypeFromString; virDomainTPMModelTypeToString; virDomainVcpuPinAdd; -virDomainVcpuPinDefArrayFree; virDomainVcpuPinDefCopy; virDomainVcpuPinDel; virDomainVcpuPinFindByVcpu; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 4b644f7df2..d20118703a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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) -- GitLab