mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
interface: Rename some virInterfaceObj* API's
Prefix should have been virInterfaceObjList since the API is operating on the list of interfaces. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
5374a1ca80
commit
e2f3e6c38e
@ -107,9 +107,10 @@ virInterfaceObjListNew(void)
|
||||
|
||||
|
||||
int
|
||||
virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjListFindByMACString(virInterfaceObjListPtr interfaces,
|
||||
const char *mac,
|
||||
virInterfaceObjPtr *matches, int maxmatches)
|
||||
virInterfaceObjPtr *matches,
|
||||
int maxmatches)
|
||||
{
|
||||
size_t i;
|
||||
unsigned int matchct = 0;
|
||||
@ -137,7 +138,7 @@ virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
|
||||
|
||||
|
||||
virInterfaceObjPtr
|
||||
virInterfaceObjFindByName(virInterfaceObjListPtr interfaces,
|
||||
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,
|
||||
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,7 +248,7 @@ virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
|
||||
|
||||
|
||||
void
|
||||
virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjListRemove(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjPtr obj)
|
||||
{
|
||||
size_t i;
|
||||
@ -268,7 +269,7 @@ virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
|
||||
|
||||
|
||||
int
|
||||
virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjListNumOfInterfaces(virInterfaceObjListPtr interfaces,
|
||||
bool wantActive)
|
||||
{
|
||||
size_t i;
|
||||
@ -287,7 +288,7 @@ virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces,
|
||||
|
||||
|
||||
int
|
||||
virInterfaceObjGetNames(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjListGetNames(virInterfaceObjListPtr interfaces,
|
||||
bool wantActive,
|
||||
char **const names,
|
||||
int maxnames)
|
||||
|
@ -42,12 +42,13 @@ virInterfaceObjListPtr
|
||||
virInterfaceObjListNew(void);
|
||||
|
||||
int
|
||||
virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjListFindByMACString(virInterfaceObjListPtr interfaces,
|
||||
const char *mac,
|
||||
virInterfaceObjPtr *matches, int maxmatches);
|
||||
virInterfaceObjPtr *matches,
|
||||
int maxmatches);
|
||||
|
||||
virInterfaceObjPtr
|
||||
virInterfaceObjFindByName(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjListFindByName(virInterfaceObjListPtr interfaces,
|
||||
const char *name);
|
||||
|
||||
void
|
||||
@ -60,11 +61,11 @@ virInterfaceObjListPtr
|
||||
virInterfaceObjListClone(virInterfaceObjListPtr interfaces);
|
||||
|
||||
virInterfaceObjPtr
|
||||
virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjListAssignDef(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceDefPtr def);
|
||||
|
||||
void
|
||||
virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjListRemove(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjPtr obj);
|
||||
|
||||
void
|
||||
@ -78,11 +79,11 @@ typedef bool
|
||||
virInterfaceDefPtr def);
|
||||
|
||||
int
|
||||
virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjListNumOfInterfaces(virInterfaceObjListPtr interfaces,
|
||||
bool wantActive);
|
||||
|
||||
int
|
||||
virInterfaceObjGetNames(virInterfaceObjListPtr interfaces,
|
||||
virInterfaceObjListGetNames(virInterfaceObjListPtr interfaces,
|
||||
bool wantActive,
|
||||
char **const names,
|
||||
int maxnames);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)) == NULL)
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user