From b96254d4a1f200ea213a6c57891ac97f012aa642 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 21 Apr 2015 13:35:33 -0400 Subject: [PATCH] conf: Move virDomainPinIsDuplicate and make static Since it's only ever referenced in domain_conf.c, make the function static, but also will need to move it to somewhere before it's referenced rather than forward referencing it. --- src/conf/domain_conf.c | 38 +++++++++++++++++++------------------- src/conf/domain_conf.h | 4 ---- src/libvirt_private.syms | 1 - 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1051936439..c453a209d6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13246,6 +13246,25 @@ virDomainIOThreadIDDefParseXML(xmlNodePtr node, } +/* Check if pin with same id already exists. */ +static bool +virDomainPinIsDuplicate(virDomainPinDefPtr *def, + int npin, + int id) +{ + size_t i; + + if (!def || !npin) + return false; + + for (i = 0; i < npin; i++) { + if (def[i]->id == id) + return true; + } + + return false; +} + /* Parse the XML definition for a vcpupin * * vcpupin has the form of @@ -17440,25 +17459,6 @@ virDomainIOThreadIDDel(virDomainDefPtr def, } } -/* Check if vcpupin with same id already exists. */ -bool -virDomainPinIsDuplicate(virDomainPinDefPtr *def, - int npin, - int id) -{ - size_t i; - - if (!def || !npin) - return false; - - for (i = 0; i < npin; i++) { - if (def[i]->id == id) - return true; - } - - return false; -} - virDomainPinDefPtr virDomainPinFind(virDomainPinDefPtr *def, int npin, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c7966a47a9..2cc7ffd8ce 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1947,10 +1947,6 @@ void virDomainPinDefArrayFree(virDomainPinDefPtr *def, int npin); virDomainPinDefPtr *virDomainPinDefCopy(virDomainPinDefPtr *src, int npin); -bool virDomainPinIsDuplicate(virDomainPinDefPtr *def, - int npin, - int id); - virDomainPinDefPtr virDomainPinFind(virDomainPinDefPtr *def, int npin, int id); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 1c345fcdab..f3d2c38deb 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -414,7 +414,6 @@ virDomainPinDefCopy; virDomainPinDefFree; virDomainPinDel; virDomainPinFind; -virDomainPinIsDuplicate; virDomainPMSuspendedReasonTypeFromString; virDomainPMSuspendedReasonTypeToString; virDomainRedirdevBusTypeFromString;