[PATCH v2 06/11] 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 dd86151..9470b4a 100644
--- a/src/conf/virinterfaceobj.c
+++ b/src/conf/virinterfaceobj.c
@@ -107,9 +107,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;
@@ -137,8 +138,8 @@ virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
 
 
 virInterfaceObjPtr
-virInterfaceObjFindByName(virInterfaceObjListPtr interfaces,
-                          const char *name)
+virInterfaceObjListFindByName(virInterfaceObjListPtr interfaces,
+                              const char *name)
 {
     size_t i;
 
@@ -198,9 +199,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;
@@ -212,12 +213,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;
 
@@ -247,8 +248,8 @@ virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
 
 
 void
-virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
-                      virInterfaceObjPtr obj)
+virInterfaceObjListRemove(virInterfaceObjListPtr interfaces,
+                          virInterfaceObjPtr obj)
 {
     size_t i;
 
@@ -268,8 +269,8 @@ virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
 
 
 int
-virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces,
-                               bool wantActive)
+virInterfaceObjListNumOfInterfaces(virInterfaceObjListPtr interfaces,
+                                   bool wantActive)
 {
     size_t i;
     int ninterfaces = 0;
@@ -287,10 +288,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 4ba99ad..aa6f351 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -910,18 +910,18 @@ virDomainObjListRename;
 
 
 # conf/virinterfaceobj.h
-virInterfaceObjAssignDef;
-virInterfaceObjFindByMACString;
-virInterfaceObjFindByName;
 virInterfaceObjGetDef;
-virInterfaceObjGetNames;
 virInterfaceObjIsActive;
+virInterfaceObjListAssignDef;
 virInterfaceObjListClone;
+virInterfaceObjListFindByMACString;
+virInterfaceObjListFindByName;
 virInterfaceObjListFree;
+virInterfaceObjListGetNames;
 virInterfaceObjListNew;
+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.4

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