mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +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
|
int
|
||||||
virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListFindByMACString(virInterfaceObjListPtr interfaces,
|
||||||
const char *mac,
|
const char *mac,
|
||||||
virInterfaceObjPtr *matches, int maxmatches)
|
virInterfaceObjPtr *matches,
|
||||||
|
int maxmatches)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
unsigned int matchct = 0;
|
unsigned int matchct = 0;
|
||||||
@ -137,7 +138,7 @@ virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
|
|||||||
|
|
||||||
|
|
||||||
virInterfaceObjPtr
|
virInterfaceObjPtr
|
||||||
virInterfaceObjFindByName(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListFindByName(virInterfaceObjListPtr interfaces,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -198,9 +199,9 @@ virInterfaceObjListClone(virInterfaceObjListPtr interfaces)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VIR_FREE(xml);
|
VIR_FREE(xml);
|
||||||
if (!(obj = virInterfaceObjAssignDef(dest, backup)))
|
if (!(obj = virInterfaceObjListAssignDef(dest, backup)))
|
||||||
goto error;
|
goto error;
|
||||||
virInterfaceObjUnlock(obj); /* locked by virInterfaceObjAssignDef */
|
virInterfaceObjUnlock(obj); /* locked by virInterfaceObjListAssignDef */
|
||||||
}
|
}
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
@ -212,12 +213,12 @@ virInterfaceObjListClone(virInterfaceObjListPtr interfaces)
|
|||||||
|
|
||||||
|
|
||||||
virInterfaceObjPtr
|
virInterfaceObjPtr
|
||||||
virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListAssignDef(virInterfaceObjListPtr interfaces,
|
||||||
virInterfaceDefPtr def)
|
virInterfaceDefPtr def)
|
||||||
{
|
{
|
||||||
virInterfaceObjPtr obj;
|
virInterfaceObjPtr obj;
|
||||||
|
|
||||||
if ((obj = virInterfaceObjFindByName(interfaces, def->name))) {
|
if ((obj = virInterfaceObjListFindByName(interfaces, def->name))) {
|
||||||
virInterfaceDefFree(obj->def);
|
virInterfaceDefFree(obj->def);
|
||||||
obj->def = def;
|
obj->def = def;
|
||||||
|
|
||||||
@ -247,7 +248,7 @@ virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListRemove(virInterfaceObjListPtr interfaces,
|
||||||
virInterfaceObjPtr obj)
|
virInterfaceObjPtr obj)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -268,7 +269,7 @@ virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListNumOfInterfaces(virInterfaceObjListPtr interfaces,
|
||||||
bool wantActive)
|
bool wantActive)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -287,7 +288,7 @@ virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virInterfaceObjGetNames(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListGetNames(virInterfaceObjListPtr interfaces,
|
||||||
bool wantActive,
|
bool wantActive,
|
||||||
char **const names,
|
char **const names,
|
||||||
int maxnames)
|
int maxnames)
|
||||||
|
@ -42,12 +42,13 @@ virInterfaceObjListPtr
|
|||||||
virInterfaceObjListNew(void);
|
virInterfaceObjListNew(void);
|
||||||
|
|
||||||
int
|
int
|
||||||
virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListFindByMACString(virInterfaceObjListPtr interfaces,
|
||||||
const char *mac,
|
const char *mac,
|
||||||
virInterfaceObjPtr *matches, int maxmatches);
|
virInterfaceObjPtr *matches,
|
||||||
|
int maxmatches);
|
||||||
|
|
||||||
virInterfaceObjPtr
|
virInterfaceObjPtr
|
||||||
virInterfaceObjFindByName(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListFindByName(virInterfaceObjListPtr interfaces,
|
||||||
const char *name);
|
const char *name);
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -60,11 +61,11 @@ virInterfaceObjListPtr
|
|||||||
virInterfaceObjListClone(virInterfaceObjListPtr interfaces);
|
virInterfaceObjListClone(virInterfaceObjListPtr interfaces);
|
||||||
|
|
||||||
virInterfaceObjPtr
|
virInterfaceObjPtr
|
||||||
virInterfaceObjAssignDef(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListAssignDef(virInterfaceObjListPtr interfaces,
|
||||||
virInterfaceDefPtr def);
|
virInterfaceDefPtr def);
|
||||||
|
|
||||||
void
|
void
|
||||||
virInterfaceObjRemove(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListRemove(virInterfaceObjListPtr interfaces,
|
||||||
virInterfaceObjPtr obj);
|
virInterfaceObjPtr obj);
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -78,11 +79,11 @@ typedef bool
|
|||||||
virInterfaceDefPtr def);
|
virInterfaceDefPtr def);
|
||||||
|
|
||||||
int
|
int
|
||||||
virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListNumOfInterfaces(virInterfaceObjListPtr interfaces,
|
||||||
bool wantActive);
|
bool wantActive);
|
||||||
|
|
||||||
int
|
int
|
||||||
virInterfaceObjGetNames(virInterfaceObjListPtr interfaces,
|
virInterfaceObjListGetNames(virInterfaceObjListPtr interfaces,
|
||||||
bool wantActive,
|
bool wantActive,
|
||||||
char **const names,
|
char **const names,
|
||||||
int maxnames);
|
int maxnames);
|
||||||
|
@ -910,18 +910,18 @@ virDomainObjListRename;
|
|||||||
|
|
||||||
|
|
||||||
# conf/virinterfaceobj.h
|
# conf/virinterfaceobj.h
|
||||||
virInterfaceObjAssignDef;
|
|
||||||
virInterfaceObjFindByMACString;
|
|
||||||
virInterfaceObjFindByName;
|
|
||||||
virInterfaceObjGetDef;
|
virInterfaceObjGetDef;
|
||||||
virInterfaceObjGetNames;
|
|
||||||
virInterfaceObjIsActive;
|
virInterfaceObjIsActive;
|
||||||
|
virInterfaceObjListAssignDef;
|
||||||
virInterfaceObjListClone;
|
virInterfaceObjListClone;
|
||||||
|
virInterfaceObjListFindByMACString;
|
||||||
|
virInterfaceObjListFindByName;
|
||||||
virInterfaceObjListFree;
|
virInterfaceObjListFree;
|
||||||
|
virInterfaceObjListGetNames;
|
||||||
virInterfaceObjListNew;
|
virInterfaceObjListNew;
|
||||||
|
virInterfaceObjListNumOfInterfaces;
|
||||||
|
virInterfaceObjListRemove;
|
||||||
virInterfaceObjLock;
|
virInterfaceObjLock;
|
||||||
virInterfaceObjNumOfInterfaces;
|
|
||||||
virInterfaceObjRemove;
|
|
||||||
virInterfaceObjSetActive;
|
virInterfaceObjSetActive;
|
||||||
virInterfaceObjUnlock;
|
virInterfaceObjUnlock;
|
||||||
|
|
||||||
|
@ -1021,7 +1021,7 @@ testParseInterfaces(testDriverPtr privconn,
|
|||||||
if (!def)
|
if (!def)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!(obj = virInterfaceObjAssignDef(privconn->ifaces, def))) {
|
if (!(obj = virInterfaceObjListAssignDef(privconn->ifaces, def))) {
|
||||||
virInterfaceDefFree(def);
|
virInterfaceDefFree(def);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -3631,7 +3631,7 @@ testInterfaceObjFindByName(testDriverPtr privconn,
|
|||||||
virInterfaceObjPtr obj;
|
virInterfaceObjPtr obj;
|
||||||
|
|
||||||
testDriverLock(privconn);
|
testDriverLock(privconn);
|
||||||
obj = virInterfaceObjFindByName(privconn->ifaces, name);
|
obj = virInterfaceObjListFindByName(privconn->ifaces, name);
|
||||||
testDriverUnlock(privconn);
|
testDriverUnlock(privconn);
|
||||||
|
|
||||||
if (!obj)
|
if (!obj)
|
||||||
@ -3650,7 +3650,7 @@ testConnectNumOfInterfaces(virConnectPtr conn)
|
|||||||
int ninterfaces;
|
int ninterfaces;
|
||||||
|
|
||||||
testDriverLock(privconn);
|
testDriverLock(privconn);
|
||||||
ninterfaces = virInterfaceObjNumOfInterfaces(privconn->ifaces, true);
|
ninterfaces = virInterfaceObjListNumOfInterfaces(privconn->ifaces, true);
|
||||||
testDriverUnlock(privconn);
|
testDriverUnlock(privconn);
|
||||||
return ninterfaces;
|
return ninterfaces;
|
||||||
}
|
}
|
||||||
@ -3665,7 +3665,8 @@ testConnectListInterfaces(virConnectPtr conn,
|
|||||||
int nnames;
|
int nnames;
|
||||||
|
|
||||||
testDriverLock(privconn);
|
testDriverLock(privconn);
|
||||||
nnames = virInterfaceObjGetNames(privconn->ifaces, true, names, maxnames);
|
nnames = virInterfaceObjListGetNames(privconn->ifaces, true,
|
||||||
|
names, maxnames);
|
||||||
testDriverUnlock(privconn);
|
testDriverUnlock(privconn);
|
||||||
|
|
||||||
return nnames;
|
return nnames;
|
||||||
@ -3679,7 +3680,7 @@ testConnectNumOfDefinedInterfaces(virConnectPtr conn)
|
|||||||
int ninterfaces;
|
int ninterfaces;
|
||||||
|
|
||||||
testDriverLock(privconn);
|
testDriverLock(privconn);
|
||||||
ninterfaces = virInterfaceObjNumOfInterfaces(privconn->ifaces, false);
|
ninterfaces = virInterfaceObjListNumOfInterfaces(privconn->ifaces, false);
|
||||||
testDriverUnlock(privconn);
|
testDriverUnlock(privconn);
|
||||||
return ninterfaces;
|
return ninterfaces;
|
||||||
}
|
}
|
||||||
@ -3694,7 +3695,8 @@ testConnectListDefinedInterfaces(virConnectPtr conn,
|
|||||||
int nnames;
|
int nnames;
|
||||||
|
|
||||||
testDriverLock(privconn);
|
testDriverLock(privconn);
|
||||||
nnames = virInterfaceObjGetNames(privconn->ifaces, false, names, maxnames);
|
nnames = virInterfaceObjListGetNames(privconn->ifaces, false,
|
||||||
|
names, maxnames);
|
||||||
testDriverUnlock(privconn);
|
testDriverUnlock(privconn);
|
||||||
|
|
||||||
return nnames;
|
return nnames;
|
||||||
@ -3732,7 +3734,7 @@ testInterfaceLookupByMACString(virConnectPtr conn,
|
|||||||
virInterfacePtr ret = NULL;
|
virInterfacePtr ret = NULL;
|
||||||
|
|
||||||
testDriverLock(privconn);
|
testDriverLock(privconn);
|
||||||
ifacect = virInterfaceObjFindByMACString(privconn->ifaces, mac, &obj, 1);
|
ifacect = virInterfaceObjListFindByMACString(privconn->ifaces, mac, &obj, 1);
|
||||||
testDriverUnlock(privconn);
|
testDriverUnlock(privconn);
|
||||||
|
|
||||||
if (ifacect == 0) {
|
if (ifacect == 0) {
|
||||||
@ -3901,7 +3903,7 @@ testInterfaceDefineXML(virConnectPtr conn,
|
|||||||
if ((def = virInterfaceDefParseString(xmlStr)) == NULL)
|
if ((def = virInterfaceDefParseString(xmlStr)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if ((obj = virInterfaceObjAssignDef(privconn->ifaces, def)) == NULL)
|
if ((obj = virInterfaceObjListAssignDef(privconn->ifaces, def)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
def = NULL;
|
def = NULL;
|
||||||
objdef = virInterfaceObjGetDef(obj);
|
objdef = virInterfaceObjGetDef(obj);
|
||||||
@ -3926,7 +3928,7 @@ testInterfaceUndefine(virInterfacePtr iface)
|
|||||||
if (!(obj = testInterfaceObjFindByName(privconn, iface->name)))
|
if (!(obj = testInterfaceObjFindByName(privconn, iface->name)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virInterfaceObjRemove(privconn->ifaces, obj);
|
virInterfaceObjListRemove(privconn->ifaces, obj);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user