diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c01b8952a0..d3dfefa449 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13529,9 +13529,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); @@ -13560,9 +13560,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; @@ -13621,9 +13621,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); @@ -16736,17 +16736,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 f991927f95..800d69730f 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1913,9 +1913,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 ed18629038..0481bfd85d 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -387,6 +387,7 @@ virDomainPausedReasonTypeToString; virDomainPinDefArrayFree; virDomainPinDefCopy; virDomainPinDefFree; +virDomainPinIsDuplicate; virDomainPMSuspendedReasonTypeFromString; virDomainPMSuspendedReasonTypeToString; virDomainRedirdevBusTypeFromString; @@ -441,7 +442,6 @@ virDomainTPMModelTypeToString; virDomainVcpuPinAdd; virDomainVcpuPinDel; virDomainVcpuPinFindByVcpu; -virDomainVcpuPinIsDuplicate; virDomainVideoDefaultRAM; virDomainVideoDefaultType; virDomainVideoDefFree;