[PATCH 6/8] interface: Rename some virInterfaceObj* API's

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

 



Prefix should have been virInterfaceObjList since the API is operating
on the list of interfaces.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/virinterfaceobj.c | 37 +++++++++++++++++++------------------
 src/conf/virinterfaceobj.h | 31 ++++++++++++++++---------------
 src/libvirt_private.syms   | 12 ++++++------
 src/test/test_driver.c     | 20 +++++++++++---------
 4 files changed, 52 insertions(+), 48 deletions(-)

diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c
index 301ad94..3aeeebd 100644
--- a/src/conf/virinterfaceobj.c
+++ b/src/conf/virinterfaceobj.c
@@ -106,9 +106,10 @@ virInterfaceObjListNew(void)
 
 
 int
-virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
-                               const char *mac,
-                               virInterfaceObjPtr *matches, int maxmatches)
+virInterfaceObjListFindByMACString(virInterfaceObjListPtr interfaces,
+                                   const char *mac,
+                                   virInterfaceObjPtr *matches,
+                                   int maxmatches)
 {
     size_t i;
     unsigned int matchct = 0;
@@ -136,8 +137,8 @@ virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
 
 
 virInterfaceObjPtr
-virInterfaceObjFindByName(virInterfaceObjListPtr interfaces,
-                          const char *name)
+virInterfaceObjListFindByName(virInterfaceObjListPtr interfaces,
+                              const char *name)
 {
     size_t i;
 
@@ -196,9 +197,9 @@ virInterfaceObjListClone(virInterfaceObjListPtr interfaces)
         }
 
         VIR_FREE(xml);
-        if (!(obj = virInterfaceObjAssignDef(dest, backup)))
+        if (!(obj = virInterfaceObjListAssignDef(dest, backup)))
             goto error;
-        virInterfaceObjUnlock(obj); /* locked by virInterfaceObjAssignDef */
+        virInterfaceObjUnlock(obj); /* locked by virInterfaceObjListAssignDef */
     }
 
     return dest;
@@ -210,12 +211,12 @@ virInterfaceObjListClone(virInterfaceObjListPtr interfaces)
 
 
 virInterfaceObjPtr
-virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
-                         virInterfaceDefPtr def)
+virInterfaceObjListAssignDef(virInterfaceObjListPtr interfaces,
+                             virInterfaceDefPtr def)
 {
     virInterfaceObjPtr obj;
 
-    if ((obj = virInterfaceObjFindByName(interfaces, def->name))) {
+    if ((obj = virInterfaceObjListFindByName(interfaces, def->name))) {
         virInterfaceDefFree(obj->def);
         obj->def = def;
 
@@ -245,8 +246,8 @@ virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
 
 
 void
-virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
-                      virInterfaceObjPtr obj)
+virInterfaceObjListRemove(virInterfaceObjListPtr interfaces,
+                          virInterfaceObjPtr obj)
 {
     size_t i;
 
@@ -266,8 +267,8 @@ virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
 
 
 int
-virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces,
-                               bool wantActive)
+virInterfaceObjListNumOfInterfaces(virInterfaceObjListPtr interfaces,
+                                   bool wantActive)
 {
     size_t i;
     int ninterfaces = 0;
@@ -285,10 +286,10 @@ virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces,
 
 
 int
-virInterfaceObjGetNames(virInterfaceObjListPtr interfaces,
-                        bool wantActive,
-                        char **const names,
-                        int maxnames)
+virInterfaceObjListGetNames(virInterfaceObjListPtr interfaces,
+                            bool wantActive,
+                            char **const names,
+                            int maxnames)
 {
     int nnames = 0;
     size_t i;
diff --git a/src/conf/virinterfaceobj.h b/src/conf/virinterfaceobj.h
index 19c4947..f1bcab9 100644
--- a/src/conf/virinterfaceobj.h
+++ b/src/conf/virinterfaceobj.h
@@ -42,13 +42,14 @@ virInterfaceObjListPtr
 virInterfaceObjListNew(void);
 
 int
-virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
-                               const char *mac,
-                               virInterfaceObjPtr *matches, int maxmatches);
+virInterfaceObjListFindByMACString(virInterfaceObjListPtr interfaces,
+                                   const char *mac,
+                                   virInterfaceObjPtr *matches,
+                                   int maxmatches);
 
 virInterfaceObjPtr
-virInterfaceObjFindByName(virInterfaceObjListPtr interfaces,
-                          const char *name);
+virInterfaceObjListFindByName(virInterfaceObjListPtr interfaces,
+                              const char *name);
 
 void
 virInterfaceObjFree(virInterfaceObjPtr obj);
@@ -60,12 +61,12 @@ virInterfaceObjListPtr
 virInterfaceObjListClone(virInterfaceObjListPtr interfaces);
 
 virInterfaceObjPtr
-virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
-                         virInterfaceDefPtr def);
+virInterfaceObjListAssignDef(virInterfaceObjListPtr interfaces,
+                             virInterfaceDefPtr def);
 
 void
-virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
-                      virInterfaceObjPtr obj);
+virInterfaceObjListRemove(virInterfaceObjListPtr interfaces,
+                          virInterfaceObjPtr obj);
 
 void
 virInterfaceObjLock(virInterfaceObjPtr obj);
@@ -78,13 +79,13 @@ typedef bool
                              virInterfaceDefPtr def);
 
 int
-virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces,
-                               bool wantActive);
+virInterfaceObjListNumOfInterfaces(virInterfaceObjListPtr interfaces,
+                                   bool wantActive);
 
 int
-virInterfaceObjGetNames(virInterfaceObjListPtr interfaces,
-                        bool wantActive,
-                        char **const names,
-                        int maxnames);
+virInterfaceObjListGetNames(virInterfaceObjListPtr interfaces,
+                            bool wantActive,
+                            char **const names,
+                            int maxnames);
 
 #endif /* __VIRINTERFACEOBJ_H__ */
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 751d1ac..4feb081 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -906,17 +906,17 @@ virDomainObjListRename;
 
 
 # conf/virinterfaceobj.h
-virInterfaceObjAssignDef;
-virInterfaceObjFindByMACString;
-virInterfaceObjFindByName;
 virInterfaceObjGetDef;
-virInterfaceObjGetNames;
 virInterfaceObjIsActive;
+virInterfaceObjListAssignDef;
 virInterfaceObjListClone;
+virInterfaceObjListFindByMACString;
+virInterfaceObjListFindByName;
 virInterfaceObjListFree;
+virInterfaceObjListGetNames;
+virInterfaceObjListNumOfInterfaces;
+virInterfaceObjListRemove;
 virInterfaceObjLock;
-virInterfaceObjNumOfInterfaces;
-virInterfaceObjRemove;
 virInterfaceObjSetActive;
 virInterfaceObjUnlock;
 
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 2cd55ec..89a705c 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1021,7 +1021,7 @@ testParseInterfaces(testDriverPtr privconn,
         if (!def)
             goto error;
 
-        if (!(obj = virInterfaceObjAssignDef(privconn->ifaces, def))) {
+        if (!(obj = virInterfaceObjListAssignDef(privconn->ifaces, def))) {
             virInterfaceDefFree(def);
             goto error;
         }
@@ -3631,7 +3631,7 @@ testInterfaceObjFindByName(testDriverPtr privconn,
     virInterfaceObjPtr obj;
 
     testDriverLock(privconn);
-    obj = virInterfaceObjFindByName(privconn->ifaces, name);
+    obj = virInterfaceObjListFindByName(privconn->ifaces, name);
     testDriverUnlock(privconn);
 
     if (!obj)
@@ -3650,7 +3650,7 @@ testConnectNumOfInterfaces(virConnectPtr conn)
     int ninterfaces;
 
     testDriverLock(privconn);
-    ninterfaces = virInterfaceObjNumOfInterfaces(privconn->ifaces, true);
+    ninterfaces = virInterfaceObjListNumOfInterfaces(privconn->ifaces, true);
     testDriverUnlock(privconn);
     return ninterfaces;
 }
@@ -3665,7 +3665,8 @@ testConnectListInterfaces(virConnectPtr conn,
     int nnames;
 
     testDriverLock(privconn);
-    nnames = virInterfaceObjGetNames(privconn->ifaces, true, names, maxnames);
+    nnames = virInterfaceObjListGetNames(privconn->ifaces, true,
+                                         names, maxnames);
     testDriverUnlock(privconn);
 
     return nnames;
@@ -3679,7 +3680,7 @@ testConnectNumOfDefinedInterfaces(virConnectPtr conn)
     int ninterfaces;
 
     testDriverLock(privconn);
-    ninterfaces = virInterfaceObjNumOfInterfaces(privconn->ifaces, false);
+    ninterfaces = virInterfaceObjListNumOfInterfaces(privconn->ifaces, false);
     testDriverUnlock(privconn);
     return ninterfaces;
 }
@@ -3694,7 +3695,8 @@ testConnectListDefinedInterfaces(virConnectPtr conn,
     int nnames;
 
     testDriverLock(privconn);
-    nnames = virInterfaceObjGetNames(privconn->ifaces, false, names, maxnames);
+    nnames = virInterfaceObjListGetNames(privconn->ifaces, false,
+                                         names, maxnames);
     testDriverUnlock(privconn);
 
     return nnames;
@@ -3732,7 +3734,7 @@ testInterfaceLookupByMACString(virConnectPtr conn,
     virInterfacePtr ret = NULL;
 
     testDriverLock(privconn);
-    ifacect = virInterfaceObjFindByMACString(privconn->ifaces, mac, &obj, 1);
+    ifacect = virInterfaceObjListFindByMACString(privconn->ifaces, mac, &obj, 1);
     testDriverUnlock(privconn);
 
     if (ifacect == 0) {
@@ -3901,7 +3903,7 @@ testInterfaceDefineXML(virConnectPtr conn,
     if (!(def = virInterfaceDefParseString(xmlStr)))
         goto cleanup;
 
-    if ((obj = virInterfaceObjAssignDef(privconn->ifaces, def)) == NULL)
+    if ((obj = virInterfaceObjListAssignDef(privconn->ifaces, def)) == NULL)
         goto cleanup;
     def = NULL;
     objdef = virInterfaceObjGetDef(obj);
@@ -3926,7 +3928,7 @@ testInterfaceUndefine(virInterfacePtr iface)
     if (!(obj = testInterfaceObjFindByName(privconn, iface->name)))
         return -1;
 
-    virInterfaceObjRemove(privconn->ifaces, obj);
+    virInterfaceObjListRemove(privconn->ifaces, obj);
 
     return 0;
 }
-- 
2.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux