You need to sign in or sign up before continuing.
提交 f4b58440 编写于 作者: J John Ferlan

nodedev: Alter @aclfilter to just @filter

Rename the variable, recent review requested just use of @filter,
so be consistent throughout.
上级 63d84f18
...@@ -732,7 +732,7 @@ virNodeDeviceCapMatch(virNodeDeviceObjPtr obj, ...@@ -732,7 +732,7 @@ virNodeDeviceCapMatch(virNodeDeviceObjPtr obj,
struct virNodeDeviceCountData { struct virNodeDeviceCountData {
virConnectPtr conn; virConnectPtr conn;
virNodeDeviceObjListFilter aclfilter; virNodeDeviceObjListFilter filter;
const char *matchstr; const char *matchstr;
int count; int count;
}; };
...@@ -745,11 +745,11 @@ virNodeDeviceObjListNumOfDevicesCallback(void *payload, ...@@ -745,11 +745,11 @@ virNodeDeviceObjListNumOfDevicesCallback(void *payload,
virNodeDeviceObjPtr obj = payload; virNodeDeviceObjPtr obj = payload;
virNodeDeviceDefPtr def; virNodeDeviceDefPtr def;
struct virNodeDeviceCountData *data = opaque; struct virNodeDeviceCountData *data = opaque;
virNodeDeviceObjListFilter aclfilter = data->aclfilter; virNodeDeviceObjListFilter filter = data->filter;
virObjectLock(obj); virObjectLock(obj);
def = obj->def; def = obj->def;
if ((!aclfilter || aclfilter(data->conn, def)) && if ((!filter || filter(data->conn, def)) &&
(!data->matchstr || virNodeDeviceObjHasCap(obj, data->matchstr))) (!data->matchstr || virNodeDeviceObjHasCap(obj, data->matchstr)))
data->count++; data->count++;
...@@ -762,10 +762,10 @@ int ...@@ -762,10 +762,10 @@ int
virNodeDeviceObjListNumOfDevices(virNodeDeviceObjListPtr devs, virNodeDeviceObjListNumOfDevices(virNodeDeviceObjListPtr devs,
virConnectPtr conn, virConnectPtr conn,
const char *cap, const char *cap,
virNodeDeviceObjListFilter aclfilter) virNodeDeviceObjListFilter filter)
{ {
struct virNodeDeviceCountData data = { struct virNodeDeviceCountData data = {
.conn = conn, .aclfilter = aclfilter, .matchstr = cap, .count = 0 }; .conn = conn, .filter = filter, .matchstr = cap, .count = 0 };
virObjectLock(devs); virObjectLock(devs);
virHashForEach(devs->objs, virNodeDeviceObjListNumOfDevicesCallback, &data); virHashForEach(devs->objs, virNodeDeviceObjListNumOfDevicesCallback, &data);
...@@ -777,7 +777,7 @@ virNodeDeviceObjListNumOfDevices(virNodeDeviceObjListPtr devs, ...@@ -777,7 +777,7 @@ virNodeDeviceObjListNumOfDevices(virNodeDeviceObjListPtr devs,
struct virNodeDeviceGetNamesData { struct virNodeDeviceGetNamesData {
virConnectPtr conn; virConnectPtr conn;
virNodeDeviceObjListFilter aclfilter; virNodeDeviceObjListFilter filter;
const char *matchstr; const char *matchstr;
int nnames; int nnames;
char **names; char **names;
...@@ -793,7 +793,7 @@ virNodeDeviceObjListGetNamesCallback(void *payload, ...@@ -793,7 +793,7 @@ virNodeDeviceObjListGetNamesCallback(void *payload,
virNodeDeviceObjPtr obj = payload; virNodeDeviceObjPtr obj = payload;
virNodeDeviceDefPtr def; virNodeDeviceDefPtr def;
struct virNodeDeviceGetNamesData *data = opaque; struct virNodeDeviceGetNamesData *data = opaque;
virNodeDeviceObjListFilter aclfilter = data->aclfilter; virNodeDeviceObjListFilter filter = data->filter;
if (data->error) if (data->error)
return 0; return 0;
...@@ -801,7 +801,7 @@ virNodeDeviceObjListGetNamesCallback(void *payload, ...@@ -801,7 +801,7 @@ virNodeDeviceObjListGetNamesCallback(void *payload,
virObjectLock(obj); virObjectLock(obj);
def = obj->def; def = obj->def;
if ((!aclfilter || aclfilter(data->conn, def)) && if ((!filter || filter(data->conn, def)) &&
(!data->matchstr || virNodeDeviceObjHasCap(obj, data->matchstr))) { (!data->matchstr || virNodeDeviceObjHasCap(obj, data->matchstr))) {
if (VIR_STRDUP(data->names[data->nnames], def->name) < 0) { if (VIR_STRDUP(data->names[data->nnames], def->name) < 0) {
data->error = true; data->error = true;
...@@ -819,13 +819,13 @@ virNodeDeviceObjListGetNamesCallback(void *payload, ...@@ -819,13 +819,13 @@ virNodeDeviceObjListGetNamesCallback(void *payload,
int int
virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs, virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs,
virConnectPtr conn, virConnectPtr conn,
virNodeDeviceObjListFilter aclfilter, virNodeDeviceObjListFilter filter,
const char *cap, const char *cap,
char **const names, char **const names,
int maxnames) int maxnames)
{ {
struct virNodeDeviceGetNamesData data = { struct virNodeDeviceGetNamesData data = {
.conn = conn, .aclfilter = aclfilter, .matchstr = cap, .names = names, .conn = conn, .filter = filter, .matchstr = cap, .names = names,
.nnames = 0, .maxnames = maxnames, .error = false }; .nnames = 0, .maxnames = maxnames, .error = false };
virObjectLock(devs); virObjectLock(devs);
...@@ -878,7 +878,7 @@ virNodeDeviceMatch(virNodeDeviceObjPtr obj, ...@@ -878,7 +878,7 @@ virNodeDeviceMatch(virNodeDeviceObjPtr obj,
struct virNodeDeviceObjListExportData { struct virNodeDeviceObjListExportData {
virConnectPtr conn; virConnectPtr conn;
virNodeDeviceObjListFilter aclfilter; virNodeDeviceObjListFilter filter;
unsigned int flags; unsigned int flags;
virNodeDevicePtr *devices; virNodeDevicePtr *devices;
int ndevices; int ndevices;
...@@ -901,7 +901,7 @@ virNodeDeviceObjListExportCallback(void *payload, ...@@ -901,7 +901,7 @@ virNodeDeviceObjListExportCallback(void *payload,
virObjectLock(obj); virObjectLock(obj);
def = obj->def; def = obj->def;
if ((!data->aclfilter || data->aclfilter(data->conn, def)) && if ((!data->filter || data->filter(data->conn, def)) &&
virNodeDeviceMatch(obj, data->flags)) { virNodeDeviceMatch(obj, data->flags)) {
if (data->devices) { if (data->devices) {
if (!(device = virGetNodeDevice(data->conn, def->name)) || if (!(device = virGetNodeDevice(data->conn, def->name)) ||
...@@ -925,11 +925,11 @@ int ...@@ -925,11 +925,11 @@ int
virNodeDeviceObjListExport(virConnectPtr conn, virNodeDeviceObjListExport(virConnectPtr conn,
virNodeDeviceObjListPtr devs, virNodeDeviceObjListPtr devs,
virNodeDevicePtr **devices, virNodeDevicePtr **devices,
virNodeDeviceObjListFilter aclfilter, virNodeDeviceObjListFilter filter,
unsigned int flags) unsigned int flags)
{ {
struct virNodeDeviceObjListExportData data = { struct virNodeDeviceObjListExportData data = {
.conn = conn, .aclfilter = aclfilter, .flags = flags, .conn = conn, .filter = filter, .flags = flags,
.devices = NULL, .ndevices = 0, .error = false }; .devices = NULL, .ndevices = 0, .error = false };
virObjectLock(devs); virObjectLock(devs);
......
...@@ -91,12 +91,12 @@ int ...@@ -91,12 +91,12 @@ int
virNodeDeviceObjListNumOfDevices(virNodeDeviceObjListPtr devs, virNodeDeviceObjListNumOfDevices(virNodeDeviceObjListPtr devs,
virConnectPtr conn, virConnectPtr conn,
const char *cap, const char *cap,
virNodeDeviceObjListFilter aclfilter); virNodeDeviceObjListFilter filter);
int int
virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs, virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs,
virConnectPtr conn, virConnectPtr conn,
virNodeDeviceObjListFilter aclfilter, virNodeDeviceObjListFilter filter,
const char *cap, const char *cap,
char **const names, char **const names,
int maxnames); int maxnames);
...@@ -105,7 +105,7 @@ int ...@@ -105,7 +105,7 @@ int
virNodeDeviceObjListExport(virConnectPtr conn, virNodeDeviceObjListExport(virConnectPtr conn,
virNodeDeviceObjListPtr devobjs, virNodeDeviceObjListPtr devobjs,
virNodeDevicePtr **devices, virNodeDevicePtr **devices,
virNodeDeviceObjListFilter aclfilter, virNodeDeviceObjListFilter filter,
unsigned int flags); unsigned int flags);
#endif /* __VIRNODEDEVICEOBJ_H__ */ #endif /* __VIRNODEDEVICEOBJ_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册