Make common between Vcpu and IOThreads
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/conf/domain_conf.c | 30 +++++++++++++++---------------
src/conf/domain_conf.h | 6 +++---
src/libvirt_private.syms | 2 +-
3 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 63e7c77..efc01bd 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13469,9 +13469,9 @@ virDomainDefParseXML(xmlDocPtr xml,
if (!vcpupin)
goto error;
- if (virDomainVcpuPinIsDuplicate(def->cputune.vcpupin,
- def->cputune.nvcpupin,
- vcpupin->id)) {
+ if (virDomainPinIsDuplicate(def->cputune.vcpupin,
+ def->cputune.nvcpupin,
+ vcpupin->id)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("duplicate vcpupin for same
vcpu"));
virDomainPinDefFree(vcpupin);
@@ -13500,9 +13500,9 @@ virDomainDefParseXML(xmlDocPtr xml,
goto error;
for (i = 0; i < def->vcpus; i++) {
- if (virDomainVcpuPinIsDuplicate(def->cputune.vcpupin,
- def->cputune.nvcpupin,
- i))
+ if (virDomainPinIsDuplicate(def->cputune.vcpupin,
+ def->cputune.nvcpupin,
+ i))
continue;
virDomainPinDefPtr vcpupin = NULL;
@@ -13561,9 +13561,9 @@ virDomainDefParseXML(xmlDocPtr xml,
if (!iothreadpin)
goto error;
- if (virDomainVcpuPinIsDuplicate(def->cputune.iothreadspin,
- def->cputune.niothreadspin,
- iothreadpin->id)) {
+ if (virDomainPinIsDuplicate(def->cputune.iothreadspin,
+ def->cputune.niothreadspin,
+ iothreadpin->id)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("duplicate iothreadpin for same iothread"));
virDomainPinDefFree(iothreadpin);
@@ -16675,17 +16675,17 @@ virDomainDefAddImplicitControllers(virDomainDefPtr def)
/* Check if vcpupin with same id already exists.
* Return 1 if exists, 0 if not. */
int
-virDomainVcpuPinIsDuplicate(virDomainPinDefPtr *def,
- int nvcpupin,
- int vcpu)
+virDomainPinIsDuplicate(virDomainPinDefPtr *def,
+ int npin,
+ int id)
{
size_t i;
- if (!def || !nvcpupin)
+ if (!def || !npin)
return 0;
- for (i = 0; i < nvcpupin; i++) {
- if (def[i]->id == vcpu)
+ for (i = 0; i < npin; i++) {
+ if (def[i]->id == id)
return 1;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 5fc4074..0fb8d01 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1909,9 +1909,9 @@ void virDomainPinDefArrayFree(virDomainPinDefPtr *def, int npin);
virDomainPinDefPtr *virDomainPinDefCopy(virDomainPinDefPtr *src,
int npin);
-int virDomainVcpuPinIsDuplicate(virDomainPinDefPtr *def,
- int nvcpupin,
- int vcpu);
+int virDomainPinIsDuplicate(virDomainPinDefPtr *def,
+ int npin,
+ int id);
virDomainPinDefPtr virDomainVcpuPinFindByVcpu(virDomainPinDefPtr *def,
int nvcpupin,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 33a50a9..365430f 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -384,6 +384,7 @@ virDomainPausedReasonTypeToString;
virDomainPinDefArrayFree;
virDomainPinDefCopy;
virDomainPinDefFree;
+virDomainPinIsDuplicate;
virDomainPMSuspendedReasonTypeFromString;
virDomainPMSuspendedReasonTypeToString;
virDomainRedirdevBusTypeFromString;
@@ -438,7 +439,6 @@ virDomainTPMModelTypeToString;
virDomainVcpuPinAdd;
virDomainVcpuPinDel;
virDomainVcpuPinFindByVcpu;
-virDomainVcpuPinIsDuplicate;
virDomainVideoDefaultRAM;
virDomainVideoDefaultType;
virDomainVideoDefFree;
--
2.1.0