Rename the virNetworkObjListFilter to be virNetworkObjListACLFilter since that's more representative of what it is. Also modify the variable @filter to be @aclfilter. In the future adding the ability to describe a generic @filter routine for the Export functions could be a useful thing.
Signed-off-by: John Ferlan <jfer...@redhat.com> --- src/conf/virnetworkobj.c | 24 ++++++++++++------------ src/conf/virnetworkobj.h | 10 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index d288dd0..2be48dd 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -1307,7 +1307,7 @@ virNetworkMatch(virNetworkObjPtr obj, struct virNetworkObjListData { virConnectPtr conn; virNetworkPtr *nets; - virNetworkObjListFilter filter; + virNetworkObjListACLFilter aclfilter; unsigned int flags; int nnets; bool error; @@ -1327,8 +1327,8 @@ virNetworkObjListPopulate(void *payload, virObjectLock(obj); - if (data->filter && - !data->filter(data->conn, obj->def)) + if (data->aclfilter && + !data->aclfilter(data->conn, obj->def)) goto cleanup; if (!virNetworkMatch(obj, data->flags)) @@ -1356,11 +1356,11 @@ int virNetworkObjListExport(virConnectPtr conn, virNetworkObjListPtr netobjs, virNetworkPtr **nets, - virNetworkObjListFilter filter, + virNetworkObjListACLFilter aclfilter, unsigned int flags) { int ret = -1; - struct virNetworkObjListData data = { conn, NULL, filter, flags, 0, false}; + struct virNetworkObjListData data = { conn, NULL, aclfilter, flags, 0, false}; virObjectLock(netobjs); if (nets && VIR_ALLOC_N(data.nets, virHashSize(netobjs->objs) + 1) < 0) @@ -1436,7 +1436,7 @@ virNetworkObjListForEach(virNetworkObjListPtr nets, struct virNetworkObjListGetHelperData { virConnectPtr conn; - virNetworkObjListFilter filter; + virNetworkObjListACLFilter aclfilter; char **names; int maxnames; bool active; @@ -1461,8 +1461,8 @@ virNetworkObjListGetHelper(void *payload, virObjectLock(obj); - if (data->filter && - !data->filter(data->conn, obj->def)) + if (data->aclfilter && + !data->aclfilter(data->conn, obj->def)) goto cleanup; if ((data->active && virNetworkObjIsActive(obj)) || @@ -1486,13 +1486,13 @@ virNetworkObjListGetNames(virNetworkObjListPtr nets, bool active, char **names, int maxnames, - virNetworkObjListFilter filter, + virNetworkObjListACLFilter aclfilter, virConnectPtr conn) { int ret = -1; struct virNetworkObjListGetHelperData data = { - conn, filter, names, maxnames, active, 0, false}; + conn, aclfilter, names, maxnames, active, 0, false}; virObjectLock(nets); virHashForEach(nets->objs, virNetworkObjListGetHelper, &data); @@ -1514,11 +1514,11 @@ virNetworkObjListGetNames(virNetworkObjListPtr nets, int virNetworkObjListNumOfNetworks(virNetworkObjListPtr nets, bool active, - virNetworkObjListFilter filter, + virNetworkObjListACLFilter aclfilter, virConnectPtr conn) { struct virNetworkObjListGetHelperData data = { - conn, filter, NULL, -1, active, 0, false}; + conn, aclfilter, NULL, -1, active, 0, false}; virObjectLock(nets); virHashForEach(nets->objs, virNetworkObjListGetHelper, &data); diff --git a/src/conf/virnetworkobj.h b/src/conf/virnetworkobj.h index f7ed387..d7199fd 100644 --- a/src/conf/virnetworkobj.h +++ b/src/conf/virnetworkobj.h @@ -153,8 +153,8 @@ virNetworkObjTaint(virNetworkObjPtr obj, virNetworkTaintFlags taint); typedef bool -(*virNetworkObjListFilter)(virConnectPtr conn, - virNetworkDefPtr def); +(*virNetworkObjListACLFilter)(virConnectPtr conn, + virNetworkDefPtr def); virNetworkObjPtr virNetworkObjAssignDef(virNetworkObjListPtr nets, @@ -219,7 +219,7 @@ int virNetworkObjListExport(virConnectPtr conn, virNetworkObjListPtr netobjs, virNetworkPtr **nets, - virNetworkObjListFilter filter, + virNetworkObjListACLFilter aclfilter, unsigned int flags); typedef int @@ -236,13 +236,13 @@ virNetworkObjListGetNames(virNetworkObjListPtr nets, bool active, char **names, int maxnames, - virNetworkObjListFilter filter, + virNetworkObjListACLFilter aclfilter, virConnectPtr conn); int virNetworkObjListNumOfNetworks(virNetworkObjListPtr nets, bool active, - virNetworkObjListFilter filter, + virNetworkObjListACLFilter aclfilter, virConnectPtr conn); void -- 2.9.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list