From 705519d8e9c6d95a70800140ed50c2f0e327e9e8 Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Fri, 22 Apr 2011 22:45:02 +0200 Subject: [PATCH] remote: Rename 'nameslen' to the common 'maxnames' Avoids special case handling in the remote generator. --- daemon/remote.c | 8 ++++---- src/remote/remote_driver.c | 12 ++++++------ src/remote/remote_protocol.c | 2 +- src/remote/remote_protocol.h | 2 +- src/remote/remote_protocol.x | 2 +- src/remote_protocol-structs | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index 7cd4a438d6..909b6c065f 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -3796,9 +3796,9 @@ remoteDispatchDomainSnapshotListNames(struct qemud_server *server ATTRIBUTE_UNUS goto cleanup; } - if (args->nameslen > REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX) { + if (args->maxnames > REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX) { virNetError(VIR_ERR_INTERNAL_ERROR, "%s", - _("nameslen > REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX")); + _("maxnames > REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX")); goto cleanup; } @@ -3806,14 +3806,14 @@ remoteDispatchDomainSnapshotListNames(struct qemud_server *server ATTRIBUTE_UNUS goto cleanup; /* Allocate return buffer. */ - if (VIR_ALLOC_N(ret->names.names_val, args->nameslen) < 0) { + if (VIR_ALLOC_N(ret->names.names_val, args->maxnames) < 0) { virReportOOMError(); goto cleanup; } len = virDomainSnapshotListNames(dom, ret->names.names_val, - args->nameslen, + args->maxnames, args->flags); if (len < 0) goto cleanup; diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index c027e6b299..105f73bb07 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -9312,7 +9312,7 @@ done: static int remoteDomainSnapshotListNames (virDomainPtr domain, char **const names, - int nameslen, unsigned int flags) + int maxnames, unsigned int flags) { int rv = -1; int i; @@ -9322,15 +9322,15 @@ remoteDomainSnapshotListNames (virDomainPtr domain, char **const names, remoteDriverLock(priv); - if (nameslen > REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX) { + if (maxnames > REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX) { remoteError(VIR_ERR_RPC, _("too many remote domain snapshot names: %d > %d"), - nameslen, REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX); + maxnames, REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX); goto done; } make_nonnull_domain(&args.dom, domain); - args.nameslen = nameslen; + args.maxnames = maxnames; args.flags = flags; memset (&ret, 0, sizeof ret); @@ -9339,10 +9339,10 @@ remoteDomainSnapshotListNames (virDomainPtr domain, char **const names, (xdrproc_t) xdr_remote_domain_snapshot_list_names_ret, (char *) &ret) == -1) goto done; - if (ret.names.names_len > nameslen) { + if (ret.names.names_len > maxnames) { remoteError(VIR_ERR_RPC, _("too many remote domain snapshots: %d > %d"), - ret.names.names_len, nameslen); + ret.names.names_len, maxnames); goto cleanup; } diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c index e85f607c3b..1bdd79ed44 100644 --- a/src/remote/remote_protocol.c +++ b/src/remote/remote_protocol.c @@ -3756,7 +3756,7 @@ xdr_remote_domain_snapshot_list_names_args (XDR *xdrs, remote_domain_snapshot_li if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) return FALSE; - if (!xdr_int (xdrs, &objp->nameslen)) + if (!xdr_int (xdrs, &objp->maxnames)) return FALSE; if (!xdr_int (xdrs, &objp->flags)) return FALSE; diff --git a/src/remote/remote_protocol.h b/src/remote/remote_protocol.h index 82d098167b..ff6903c789 100644 --- a/src/remote/remote_protocol.h +++ b/src/remote/remote_protocol.h @@ -2119,7 +2119,7 @@ typedef struct remote_domain_snapshot_num_ret remote_domain_snapshot_num_ret; struct remote_domain_snapshot_list_names_args { remote_nonnull_domain dom; - int nameslen; + int maxnames; int flags; }; typedef struct remote_domain_snapshot_list_names_args remote_domain_snapshot_list_names_args; diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 0422c7b6ca..0858096b96 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -1874,7 +1874,7 @@ struct remote_domain_snapshot_num_ret { struct remote_domain_snapshot_list_names_args { remote_nonnull_domain dom; - int nameslen; + int maxnames; int flags; }; diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index 73c720216f..d433f6bc40 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -1371,7 +1371,7 @@ struct remote_domain_snapshot_num_ret { }; struct remote_domain_snapshot_list_names_args { remote_nonnull_domain dom; - int nameslen; + int maxnames; int flags; }; struct remote_domain_snapshot_list_names_ret { -- GitLab