Use "virInterfaceObj" as a prefix for any external API in virinterfaceobj
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/conf/virinterfaceobj.c | 24 ++++++++++++------------
src/conf/virinterfaceobj.h | 18 +++++++++---------
src/libvirt_private.syms | 8 ++++----
src/test/test_driver.c | 25 ++++++++++---------------
4 files changed, 35 insertions(+), 40 deletions(-)
diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c
index 70f9001..3af972b 100644
--- a/src/conf/virinterfaceobj.c
+++ b/src/conf/virinterfaceobj.c
@@ -64,9 +64,9 @@ virInterfaceObjFree(virInterfaceObjPtr iface)
/* virInterfaceObjList manipulation */
int
-virInterfaceFindByMACString(virInterfaceObjListPtr interfaces,
- const char *mac,
- virInterfaceObjPtr *matches, int maxmatches)
+virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
+ const char *mac,
+ virInterfaceObjPtr *matches, int maxmatches)
{
size_t i;
unsigned int matchct = 0;
@@ -91,8 +91,8 @@ virInterfaceFindByMACString(virInterfaceObjListPtr interfaces,
virInterfaceObjPtr
-virInterfaceFindByName(virInterfaceObjListPtr interfaces,
- const char *name)
+virInterfaceObjFindByName(virInterfaceObjListPtr interfaces,
+ const char *name)
{
size_t i;
@@ -148,9 +148,9 @@ virInterfaceObjListClone(virInterfaceObjListPtr src,
}
VIR_FREE(xml);
- if ((iface = virInterfaceAssignDef(dest, backup)) == NULL)
+ if ((iface = virInterfaceObjAssignDef(dest, backup)) == NULL)
goto cleanup;
- virInterfaceObjUnlock(iface); /* was locked by virInterfaceAssignDef */
+ virInterfaceObjUnlock(iface); /* locked by virInterfaceObjAssignDef */
}
ret = cnt;
@@ -162,12 +162,12 @@ virInterfaceObjListClone(virInterfaceObjListPtr src,
virInterfaceObjPtr
-virInterfaceAssignDef(virInterfaceObjListPtr interfaces,
- virInterfaceDefPtr def)
+virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
+ virInterfaceDefPtr def)
{
virInterfaceObjPtr iface;
- if ((iface = virInterfaceFindByName(interfaces, def->name))) {
+ if ((iface = virInterfaceObjFindByName(interfaces, def->name))) {
virInterfaceDefFree(iface->def);
iface->def = def;
@@ -197,8 +197,8 @@ virInterfaceAssignDef(virInterfaceObjListPtr interfaces,
void
-virInterfaceRemove(virInterfaceObjListPtr interfaces,
- virInterfaceObjPtr iface)
+virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
+ virInterfaceObjPtr iface)
{
size_t i;
diff --git a/src/conf/virinterfaceobj.h b/src/conf/virinterfaceobj.h
index 51d7c75..dfda748 100644
--- a/src/conf/virinterfaceobj.h
+++ b/src/conf/virinterfaceobj.h
@@ -44,11 +44,11 @@ virInterfaceObjIsActive(const virInterfaceObj *iface)
return iface->active;
}
-int virInterfaceFindByMACString(virInterfaceObjListPtr interfaces,
- const char *mac,
- virInterfaceObjPtr *matches, int maxmatches);
-virInterfaceObjPtr virInterfaceFindByName(virInterfaceObjListPtr interfaces,
- const char *name);
+int virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
+ const char *mac,
+ virInterfaceObjPtr *matches, int maxmatches);
+virInterfaceObjPtr virInterfaceObjFindByName(virInterfaceObjListPtr interfaces,
+ const char *name);
void virInterfaceObjFree(virInterfaceObjPtr iface);
@@ -57,10 +57,10 @@ int virInterfaceObjListClone(virInterfaceObjListPtr src,
virInterfaceObjListPtr dest);
-virInterfaceObjPtr virInterfaceAssignDef(virInterfaceObjListPtr interfaces,
- virInterfaceDefPtr def);
-void virInterfaceRemove(virInterfaceObjListPtr interfaces,
- virInterfaceObjPtr iface);
+virInterfaceObjPtr virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
+ virInterfaceDefPtr def);
+void virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
+ virInterfaceObjPtr iface);
void virInterfaceObjLock(virInterfaceObjPtr obj);
void virInterfaceObjUnlock(virInterfaceObjPtr obj);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index b39e17d..2349ce0 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -941,14 +941,14 @@ virDomainObjListRename;
# conf/virinterfaceobj.h
-virInterfaceAssignDef;
-virInterfaceFindByMACString;
-virInterfaceFindByName;
+virInterfaceObjAssignDef;
+virInterfaceObjFindByMACString;
+virInterfaceObjFindByName;
virInterfaceObjListClone;
virInterfaceObjListFree;
virInterfaceObjLock;
+virInterfaceObjRemove;
virInterfaceObjUnlock;
-virInterfaceRemove;
# conf/virnodedeviceobj.h
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index e72a91f..2fd9776 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1019,7 +1019,7 @@ testParseInterfaces(testDriverPtr privconn,
if (!def)
goto error;
- if (!(obj = virInterfaceAssignDef(&privconn->ifaces, def))) {
+ if (!(obj = virInterfaceObjAssignDef(&privconn->ifaces, def))) {
virInterfaceDefFree(def);
goto error;
}
@@ -3738,7 +3738,7 @@ static virInterfacePtr testInterfaceLookupByName(virConnectPtr
conn,
virInterfacePtr ret = NULL;
testDriverLock(privconn);
- iface = virInterfaceFindByName(&privconn->ifaces, name);
+ iface = virInterfaceObjFindByName(&privconn->ifaces, name);
testDriverUnlock(privconn);
if (iface == NULL) {
@@ -3763,7 +3763,7 @@ static virInterfacePtr testInterfaceLookupByMACString(virConnectPtr
conn,
virInterfacePtr ret = NULL;
testDriverLock(privconn);
- ifacect = virInterfaceFindByMACString(&privconn->ifaces, mac, &iface, 1);
+ ifacect = virInterfaceObjFindByMACString(&privconn->ifaces, mac, &iface,
1);
testDriverUnlock(privconn);
if (ifacect == 0) {
@@ -3791,7 +3791,7 @@ static int testInterfaceIsActive(virInterfacePtr iface)
int ret = -1;
testDriverLock(privconn);
- obj = virInterfaceFindByName(&privconn->ifaces, iface->name);
+ obj = virInterfaceObjFindByName(&privconn->ifaces, iface->name);
testDriverUnlock(privconn);
if (!obj) {
virReportError(VIR_ERR_NO_INTERFACE, NULL);
@@ -3902,8 +3902,7 @@ static char *testInterfaceGetXMLDesc(virInterfacePtr iface,
virCheckFlags(0, NULL);
testDriverLock(privconn);
- privinterface = virInterfaceFindByName(&privconn->ifaces,
- iface->name);
+ privinterface = virInterfaceObjFindByName(&privconn->ifaces, iface->name);
testDriverUnlock(privconn);
if (privinterface == NULL) {
@@ -3934,7 +3933,7 @@ static virInterfacePtr testInterfaceDefineXML(virConnectPtr conn,
const char *xm
if ((def = virInterfaceDefParseString(xmlStr)) == NULL)
goto cleanup;
- if ((iface = virInterfaceAssignDef(&privconn->ifaces, def)) == NULL)
+ if ((iface = virInterfaceObjAssignDef(&privconn->ifaces, def)) == NULL)
goto cleanup;
def = NULL;
@@ -3955,16 +3954,14 @@ static int testInterfaceUndefine(virInterfacePtr iface)
int ret = -1;
testDriverLock(privconn);
- privinterface = virInterfaceFindByName(&privconn->ifaces,
- iface->name);
+ privinterface = virInterfaceObjFindByName(&privconn->ifaces, iface->name);
if (privinterface == NULL) {
virReportError(VIR_ERR_NO_INTERFACE, NULL);
goto cleanup;
}
- virInterfaceRemove(&privconn->ifaces,
- privinterface);
+ virInterfaceObjRemove(&privconn->ifaces, privinterface);
ret = 0;
cleanup:
@@ -3982,8 +3979,7 @@ static int testInterfaceCreate(virInterfacePtr iface,
virCheckFlags(0, -1);
testDriverLock(privconn);
- privinterface = virInterfaceFindByName(&privconn->ifaces,
- iface->name);
+ privinterface = virInterfaceObjFindByName(&privconn->ifaces, iface->name);
if (privinterface == NULL) {
virReportError(VIR_ERR_NO_INTERFACE, NULL);
@@ -4015,8 +4011,7 @@ static int testInterfaceDestroy(virInterfacePtr iface,
virCheckFlags(0, -1);
testDriverLock(privconn);
- privinterface = virInterfaceFindByName(&privconn->ifaces,
- iface->name);
+ privinterface = virInterfaceObjFindByName(&privconn->ifaces, iface->name);
if (privinterface == NULL) {
virReportError(VIR_ERR_NO_INTERFACE, NULL);
--
2.9.3