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

[libvirt] [PATCH v5 03/10] 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 b84a447..ddb0d83 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13245,6 +13245,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
@@ -17439,25 +17458,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 c7966a4..2cc7ffd 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 1c345fc..f3d2c38 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -414,7 +414,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]