[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v4 3/9] 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.

Signed-off-by: John Ferlan <jferlan redhat com>
---
 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 da1bb7e..bd25d52 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13238,6 +13238,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
@@ -17415,25 +17434,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 2d53a8d..cc98f3d 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 77f6797..a0f4152 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -413,7 +413,6 @@ virDomainPinDefCopy;
 virDomainPinDefFree;
 virDomainPinDel;
 virDomainPinFind;
-virDomainPinIsDuplicate;
 virDomainPMSuspendedReasonTypeFromString;
 virDomainPMSuspendedReasonTypeToString;
 virDomainRedirdevBusTypeFromString;
-- 
2.1.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]