On 08/15/2017 11:32 AM, Michal Privoznik wrote:
On 07/26/2017 05:05 PM, John Ferlan wrote:
> 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;
Correct. @nnames may suggest there's @nnames items in @names array.
However, there's @got items! Very confusing.
True, changing @got to @nnames fixes that though... and of course
moving it closer to char **names;... and yet another reason why all this
has been "confusing" thus far... Would you like to see that patch or is
there enough trust that I know how to do that safely ;-).
I probably wrote this with future code in mind where all those values
are clearer anyway.
John