conf: Use consistent function name prefixes for virinterfaceobj

Use "virInterfaceObj" as a prefix for any external API in virinterfaceobj
This commit is contained in:
John Ferlan 2017-03-02 11:56:43 -05:00
parent 7e702a862d
commit e858232e4d
4 changed files with 35 additions and 40 deletions

View File

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

View File

@ -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);

View File

@ -941,14 +941,14 @@ virDomainObjListRename;
# conf/virinterfaceobj.h
virInterfaceAssignDef;
virInterfaceFindByMACString;
virInterfaceFindByName;
virInterfaceObjAssignDef;
virInterfaceObjFindByMACString;
virInterfaceObjFindByName;
virInterfaceObjListClone;
virInterfaceObjListFree;
virInterfaceObjLock;
virInterfaceObjRemove;
virInterfaceObjUnlock;
virInterfaceRemove;
# conf/virnodedeviceobj.h

View File

@ -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);