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 0c7173a..f42e2db 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -3790,9 +3790,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;
}
@@ -3800,14 +3800,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 9d6056b..935f321 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 e85f607..1bdd79e 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 82d0981..ff6903c 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 0422c7b..0858096 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 73c7202..d433f6b 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 {
--
1.7.0.4