network: Use @maxnames instead of @nnames

To be consistent with the API definition, use the @maxnames instead
of @nnames when describing/comparing against the maximum names to
be provided for the *ConnectList[Defined]Networks APIs.

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2017-07-26 10:18:39 -04:00
parent 178ac3d133
commit 8473859a47
4 changed files with 14 additions and 14 deletions

View File

@ -1420,7 +1420,7 @@ struct virNetworkObjListGetHelperData {
virConnectPtr conn;
virNetworkObjListFilter filter;
char **names;
int nnames;
int maxnames;
bool active;
int got;
bool error;
@ -1437,8 +1437,8 @@ virNetworkObjListGetHelper(void *payload,
if (data->error)
return 0;
if (data->nnames >= 0 &&
data->got == data->nnames)
if (data->maxnames >= 0 &&
data->got == data->maxnames)
return 0;
virObjectLock(obj);
@ -1467,14 +1467,14 @@ int
virNetworkObjListGetNames(virNetworkObjListPtr nets,
bool active,
char **names,
int nnames,
int maxnames,
virNetworkObjListFilter filter,
virConnectPtr conn)
{
int ret = -1;
struct virNetworkObjListGetHelperData data = {
conn, filter, names, nnames, active, 0, false};
conn, filter, names, maxnames, active, 0, false};
virObjectLock(nets);
virHashForEach(nets->objs, virNetworkObjListGetHelper, &data);

View File

@ -227,7 +227,7 @@ int
virNetworkObjListGetNames(virNetworkObjListPtr nets,
bool active,
char **names,
int nnames,
int maxnames,
virNetworkObjListFilter filter,
virConnectPtr conn);

View File

@ -2946,7 +2946,7 @@ networkConnectNumOfNetworks(virConnectPtr conn)
static int
networkConnectListNetworks(virConnectPtr conn,
char **const names,
int nnames)
int maxnames)
{
virNetworkDriverStatePtr driver = networkGetDriver();
int got = 0;
@ -2955,7 +2955,7 @@ networkConnectListNetworks(virConnectPtr conn,
return -1;
got = virNetworkObjListGetNames(driver->networks,
true, names, nnames,
true, names, maxnames,
virConnectListNetworksCheckACL,
conn);
@ -2984,7 +2984,7 @@ networkConnectNumOfDefinedNetworks(virConnectPtr conn)
static int
networkConnectListDefinedNetworks(virConnectPtr conn,
char **const names,
int nnames)
int maxnames)
{
virNetworkDriverStatePtr driver = networkGetDriver();
int got = 0;
@ -2993,7 +2993,7 @@ networkConnectListDefinedNetworks(virConnectPtr conn,
return -1;
got = virNetworkObjListGetNames(driver->networks,
false, names, nnames,
false, names, maxnames,
virConnectListDefinedNetworksCheckACL,
conn);
return got;

View File

@ -3299,13 +3299,13 @@ testConnectNumOfNetworks(virConnectPtr conn)
static int
testConnectListNetworks(virConnectPtr conn,
char **const names,
int nnames)
int maxnames)
{
testDriverPtr privconn = conn->privateData;
int n;
n = virNetworkObjListGetNames(privconn->networks,
true, names, nnames, NULL, conn);
true, names, maxnames, NULL, conn);
return n;
}
@ -3325,13 +3325,13 @@ testConnectNumOfDefinedNetworks(virConnectPtr conn)
static int
testConnectListDefinedNetworks(virConnectPtr conn,
char **const names,
int nnames)
int maxnames)
{
testDriverPtr privconn = conn->privateData;
int n;
n = virNetworkObjListGetNames(privconn->networks,
false, names, nnames, NULL, conn);
false, names, maxnames, NULL, conn);
return n;
}