args->flags)) < 0)
goto cleanup;
+ if (ndomains > REMOTE_DOMAIN_LIST_MAX) {
+ virReportError(VIR_ERR_RPC,
+ _("Too many domains '%d' for limit '%d'"),
+ ndomains, REMOTE_DOMAIN_LIST_MAX);
+ goto cleanup;
+ }
+
if (doms && ndomains) {
if (VIR_ALLOC_N(ret->domains.domains_val, ndomains) < 0)
goto cleanup;
remoteDriverLock(priv);
- if (maxids > REMOTE_DOMAIN_ID_LIST_MAX) {
+ if (maxids > REMOTE_DOMAIN_LIST_MAX) {
virReportError(VIR_ERR_RPC,
- _("too many remote domain IDs: %d > %d"),
- maxids, REMOTE_DOMAIN_ID_LIST_MAX);
+ _("Too many domains '%d' for limit '%d'"),
+ maxids, REMOTE_DOMAIN_LIST_MAX);
goto done;
}
args.maxids = maxids;
if (ret.ids.ids_len > maxids) {
virReportError(VIR_ERR_RPC,
- _("too many remote domain IDs: %d > %d"),
+ _("Too many domains '%d' for limit '%d'"),
ret.ids.ids_len, maxids);
goto cleanup;
}
(char *) &ret) == -1)
goto done;
+ if (ret.domains.domains_len > REMOTE_DOMAIN_LIST_MAX) {
+ virReportError(VIR_ERR_RPC,
+ _("Too many domains '%d' for limit '%d'"),
+ ret.domains.domains_len, REMOTE_DOMAIN_LIST_MAX);
+ goto cleanup;
+ }
+
if (domains) {
if (VIR_ALLOC_N(doms, ret.domains.domains_len + 1) < 0)
goto cleanup;
/* A long string, which may be NULL. */
typedef remote_nonnull_string *remote_string;
-/* This just places an upper limit on the length of lists of
- * domain IDs which may be sent via the protocol.
- */
-const REMOTE_DOMAIN_ID_LIST_MAX = 16384;
-
-/* Upper limit on lists of domain names. */
-const REMOTE_DOMAIN_NAME_LIST_MAX = 16384;
+/* Upper limit on lists of domains. */
+const REMOTE_DOMAIN_LIST_MAX = 16384;
/* Upper limit on cpumap (bytes) passed to virDomainPinVcpu. */
const REMOTE_CPUMAP_MAX = 2048;
};
struct remote_connect_list_domains_ret {
- int ids<REMOTE_DOMAIN_ID_LIST_MAX>; /* insert@1 */
+ int ids<REMOTE_DOMAIN_LIST_MAX>; /* insert@1 */
};
struct remote_connect_num_of_domains_ret {
};
struct remote_connect_list_defined_domains_ret {
- remote_nonnull_string names<REMOTE_DOMAIN_NAME_LIST_MAX>; /* insert@1 */
+ remote_nonnull_string names<REMOTE_DOMAIN_LIST_MAX>; /* insert@1 */
};
struct remote_connect_num_of_defined_domains_ret {
};
struct remote_connect_list_all_domains_ret {
- remote_nonnull_domain domains<>;
+ remote_nonnull_domain domains<REMOTE_DOMAIN_LIST_MAX>;
unsigned int ret;
};