mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 17:18:01 +03:00
remote: Rename 'nameslen' to the common 'maxnames'
Avoids special case handling in the remote generator.
This commit is contained in:
parent
9a74649cd2
commit
705519d8e9
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user