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(a)redhat.com>
---
src/conf/virnetworkobj.c | 10 +++++-----
src/conf/virnetworkobj.h | 2 +-
src/network/bridge_driver.c | 8 ++++----
src/test/test_driver.c | 8 ++++----
4 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c
index 43fc2cf..d288dd0 100644
--- a/src/conf/virnetworkobj.c
+++ b/src/conf/virnetworkobj.c
@@ -1438,7 +1438,7 @@ struct virNetworkObjListGetHelperData {
virConnectPtr conn;
virNetworkObjListFilter filter;
char **names;
- int nnames;
+ int maxnames;
bool active;
int got;
bool error;
@@ -1455,8 +1455,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);
@@ -1485,14 +1485,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);
diff --git a/src/conf/virnetworkobj.h b/src/conf/virnetworkobj.h
index 96f9eff..f7ed387 100644
--- a/src/conf/virnetworkobj.h
+++ b/src/conf/virnetworkobj.h
@@ -235,7 +235,7 @@ int
virNetworkObjListGetNames(virNetworkObjListPtr nets,
bool active,
char **names,
- int nnames,
+ int maxnames,
virNetworkObjListFilter filter,
virConnectPtr conn);
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 2433e4f..d2d983d 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2945,7 +2945,7 @@ networkConnectNumOfNetworks(virConnectPtr conn)
static int
networkConnectListNetworks(virConnectPtr conn,
char **const names,
- int nnames)
+ int maxnames)
{
virNetworkDriverStatePtr driver = networkGetDriver();
int got = 0;
@@ -2954,7 +2954,7 @@ networkConnectListNetworks(virConnectPtr conn,
return -1;
got = virNetworkObjListGetNames(driver->networks,
- true, names, nnames,
+ true, names, maxnames,
virConnectListNetworksCheckACL,
conn);
@@ -2983,7 +2983,7 @@ networkConnectNumOfDefinedNetworks(virConnectPtr conn)
static int
networkConnectListDefinedNetworks(virConnectPtr conn,
char **const names,
- int nnames)
+ int maxnames)
{
virNetworkDriverStatePtr driver = networkGetDriver();
int got = 0;
@@ -2992,7 +2992,7 @@ networkConnectListDefinedNetworks(virConnectPtr conn,
return -1;
got = virNetworkObjListGetNames(driver->networks,
- false, names, nnames,
+ false, names, maxnames,
virConnectListDefinedNetworksCheckACL,
conn);
return got;
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index e306f1e..4b8699b 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -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;
}
--
2.9.4