args->flags)) < 0)
goto cleanup;
+ if (npools > REMOTE_STORAGE_POOL_LIST_MAX) {
+ virReportError(VIR_ERR_RPC,
+ _("Too many storage pools '%d' for limit '%d'"),
+ npools, REMOTE_STORAGE_POOL_LIST_MAX);
+ goto cleanup;
+ }
+
if (pools && npools) {
if (VIR_ALLOC_N(ret->pools.pools_val, npools) < 0)
goto cleanup;
(char *) &ret) == -1)
goto done;
+ if (ret.pools.pools_len > REMOTE_STORAGE_POOL_LIST_MAX) {
+ virReportError(VIR_ERR_RPC,
+ _("Too many storage pools '%d' for limit '%d'"),
+ ret.pools.pools_len, REMOTE_STORAGE_POOL_LIST_MAX);
+ goto cleanup;
+ }
+
if (pools) {
if (VIR_ALLOC_N(tmp_pools, ret.pools.pools_len + 1) < 0)
goto cleanup;
/* Upper limit on lists of defined interface names. */
const REMOTE_DEFINED_INTERFACE_NAME_LIST_MAX = 16384;
-/* Upper limit on lists of storage pool names. */
-const REMOTE_STORAGE_POOL_NAME_LIST_MAX = 4096;
+/* Upper limit on lists of storage pools. */
+const REMOTE_STORAGE_POOL_LIST_MAX = 4096;
/* Upper limit on lists of storage vol names. */
const REMOTE_STORAGE_VOL_NAME_LIST_MAX = 16384;
};
struct remote_connect_list_storage_pools_ret {
- remote_nonnull_string names<REMOTE_STORAGE_POOL_NAME_LIST_MAX>; /* insert@1 */
+ remote_nonnull_string names<REMOTE_STORAGE_POOL_LIST_MAX>; /* insert@1 */
};
struct remote_connect_num_of_defined_storage_pools_ret {
};
struct remote_connect_list_defined_storage_pools_ret {
- remote_nonnull_string names<REMOTE_STORAGE_POOL_NAME_LIST_MAX>; /* insert@1 */
+ remote_nonnull_string names<REMOTE_STORAGE_POOL_LIST_MAX>; /* insert@1 */
};
struct remote_connect_find_storage_pool_sources_args {
};
struct remote_connect_list_all_storage_pools_ret {
- remote_nonnull_storage_pool pools<>;
+ remote_nonnull_storage_pool pools<REMOTE_STORAGE_POOL_LIST_MAX>;
unsigned int ret;
};