Make common between Vcpu and IOThreads
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
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 db04855..e5a8011 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 3f04832..a126668 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1904,7 +1904,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 adcb456..8796b31 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -381,6 +381,7 @@ virDomainObjTaint;
virDomainParseMemory;
virDomainPausedReasonTypeFromString;
virDomainPausedReasonTypeToString;
+virDomainPinDefArrayFree;
virDomainPinDefFree;
virDomainPMSuspendedReasonTypeFromString;
virDomainPMSuspendedReasonTypeToString;
@@ -434,7 +435,6 @@ virDomainTPMDefFree;
virDomainTPMModelTypeFromString;
virDomainTPMModelTypeToString;
virDomainVcpuPinAdd;
-virDomainVcpuPinDefArrayFree;
virDomainVcpuPinDefCopy;
virDomainVcpuPinDel;
virDomainVcpuPinFindByVcpu;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fed0c0d..b3eacf8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5009,8 +5009,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;
@@ -5066,7 +5066,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
cleanup:
if (newVcpuPin)
- virDomainVcpuPinDefArrayFree(newVcpuPin, newVcpuPinNum);
+ virDomainPinDefArrayFree(newVcpuPin, newVcpuPinNum);
if (cgroup_vcpu)
virCgroupFree(&cgroup_vcpu);
qemuDomObjEndAPI(&vm);
@@ -5258,7 +5258,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;
}
@@ -5299,7 +5299,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
}
if (newVcpuPin)
- virDomainVcpuPinDefArrayFree(newVcpuPin, newVcpuPinNum);
+ virDomainPinDefArrayFree(newVcpuPin, newVcpuPinNum);
} else {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cpu affinity is not
supported"));
@@ -5886,8 +5886,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;
@@ -5947,7 +5947,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
cleanup:
if (newIOThreadsPin)
- virDomainVcpuPinDefArrayFree(newIOThreadsPin, newIOThreadsPinNum);
+ virDomainPinDefArrayFree(newIOThreadsPin, newIOThreadsPinNum);
if (cgroup_iothread)
virCgroupFree(&cgroup_iothread);
if (event)
--
2.1.0