conf: rename Match functions

name match functions to be the vir prefix and interface name followed by ObjMatch

    ex. for virNetworkObjListExport, the match function is named
        virNetworkObjMatch

Signed-off-by: Anya Harter <aharter@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Anya Harter 2018-08-13 11:55:16 -04:00 committed by Andrea Bolognani
parent 1d8721c480
commit 794080b486
4 changed files with 13 additions and 13 deletions

View File

@ -1284,8 +1284,8 @@ virNetworkObjUpdate(virNetworkObjPtr obj,
#define MATCH(FLAG) (flags & (FLAG)) #define MATCH(FLAG) (flags & (FLAG))
static bool static bool
virNetworkMatch(virNetworkObjPtr obj, virNetworkObjMatch(virNetworkObjPtr obj,
unsigned int flags) unsigned int flags)
{ {
/* filter by active state */ /* filter by active state */
if (MATCH(VIR_CONNECT_LIST_NETWORKS_FILTERS_ACTIVE) && if (MATCH(VIR_CONNECT_LIST_NETWORKS_FILTERS_ACTIVE) &&
@ -1345,7 +1345,7 @@ virNetworkObjListExportCallback(void *payload,
!data->filter(data->conn, obj->def)) !data->filter(data->conn, obj->def))
goto cleanup; goto cleanup;
if (!virNetworkMatch(obj, data->flags)) if (!virNetworkObjMatch(obj, data->flags))
goto cleanup; goto cleanup;
if (!data->nets) { if (!data->nets) {
@ -1561,7 +1561,7 @@ virNetworkObjListPruneHelper(const void *payload,
int want = 0; int want = 0;
virObjectLock(obj); virObjectLock(obj);
want = virNetworkMatch(obj, data->flags); want = virNetworkObjMatch(obj, data->flags);
virObjectUnlock(obj); virObjectUnlock(obj);
return want; return want;
} }

View File

@ -804,8 +804,8 @@ virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs,
#define MATCH(FLAG) ((flags & (VIR_CONNECT_LIST_NODE_DEVICES_CAP_ ## FLAG)) && \ #define MATCH(FLAG) ((flags & (VIR_CONNECT_LIST_NODE_DEVICES_CAP_ ## FLAG)) && \
virNodeDeviceObjHasCap(obj, VIR_NODE_DEV_CAP_ ## FLAG)) virNodeDeviceObjHasCap(obj, VIR_NODE_DEV_CAP_ ## FLAG))
static bool static bool
virNodeDeviceMatch(virNodeDeviceObjPtr obj, virNodeDeviceObjMatch(virNodeDeviceObjPtr obj,
unsigned int flags) unsigned int flags)
{ {
/* Refresh the capabilities first, e.g. due to a driver change */ /* Refresh the capabilities first, e.g. due to a driver change */
if (!obj->skipUpdateCaps && if (!obj->skipUpdateCaps &&
@ -866,7 +866,7 @@ virNodeDeviceObjListExportCallback(void *payload,
def = obj->def; def = obj->def;
if ((!data->filter || data->filter(data->conn, def)) && if ((!data->filter || data->filter(data->conn, def)) &&
virNodeDeviceMatch(obj, data->flags)) { virNodeDeviceObjMatch(obj, data->flags)) {
if (data->devices) { if (data->devices) {
if (!(device = virGetNodeDevice(data->conn, def->name)) || if (!(device = virGetNodeDevice(data->conn, def->name)) ||
VIR_STRDUP(device->parentName, def->parent) < 0) { VIR_STRDUP(device->parentName, def->parent) < 0) {

View File

@ -500,8 +500,8 @@ virSecretObjListNumOfSecrets(virSecretObjListPtr secrets,
#define MATCH(FLAG) (flags & (FLAG)) #define MATCH(FLAG) (flags & (FLAG))
static bool static bool
virSecretObjMatchFlags(virSecretObjPtr obj, virSecretObjMatch(virSecretObjPtr obj,
unsigned int flags) unsigned int flags)
{ {
virSecretDefPtr def = obj->def; virSecretDefPtr def = obj->def;
@ -556,7 +556,7 @@ virSecretObjListExportCallback(void *payload,
if (data->filter && !data->filter(data->conn, def)) if (data->filter && !data->filter(data->conn, def))
goto cleanup; goto cleanup;
if (!virSecretObjMatchFlags(obj, data->flags)) if (!virSecretObjMatch(obj, data->flags))
goto cleanup; goto cleanup;
if (!data->secrets) { if (!data->secrets) {

View File

@ -1910,8 +1910,8 @@ virStoragePoolObjSourceFindDuplicate(virConnectPtr conn,
#define MATCH(FLAG) (flags & (FLAG)) #define MATCH(FLAG) (flags & (FLAG))
static bool static bool
virStoragePoolMatch(virStoragePoolObjPtr obj, virStoragePoolObjMatch(virStoragePoolObjPtr obj,
unsigned int flags) unsigned int flags)
{ {
/* filter by active state */ /* filter by active state */
if (MATCH(VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ACTIVE) && if (MATCH(VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ACTIVE) &&
@ -2005,7 +2005,7 @@ virStoragePoolObjListExportCallback(void *payload,
if (data->filter && !data->filter(data->conn, obj->def)) if (data->filter && !data->filter(data->conn, obj->def))
goto cleanup; goto cleanup;
if (!virStoragePoolMatch(obj, data->flags)) if (!virStoragePoolObjMatch(obj, data->flags))
goto cleanup; goto cleanup;
if (data->pools) { if (data->pools) {