Convert virDomainVcpuPinIsDuplicate into virDomainPinIsDuplicate

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:
John Ferlan 2015-03-10 20:27:39 -04:00
parent c16723f606
commit 8cf80b517e
3 changed files with 19 additions and 19 deletions

View File

@ -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;
}

View File

@ -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,

View File

@ -387,6 +387,7 @@ virDomainPausedReasonTypeToString;
virDomainPinDefArrayFree;
virDomainPinDefCopy;
virDomainPinDefFree;
virDomainPinIsDuplicate;
virDomainPMSuspendedReasonTypeFromString;
virDomainPMSuspendedReasonTypeToString;
virDomainRedirdevBusTypeFromString;
@ -441,7 +442,6 @@ virDomainTPMModelTypeToString;
virDomainVcpuPinAdd;
virDomainVcpuPinDel;
virDomainVcpuPinFindByVcpu;
virDomainVcpuPinIsDuplicate;
virDomainVideoDefaultRAM;
virDomainVideoDefaultType;
virDomainVideoDefFree;