return rc;
}
-int libxl_domain_need_memory(libxl_ctx *ctx, libxl_domain_build_info *b_info,
+int libxl_domain_need_memory(libxl_ctx *ctx,
+ const libxl_domain_build_info *b_info_in,
uint32_t *need_memkb)
{
GC_INIT(ctx);
+ libxl_domain_build_info b_info[1];
int rc;
+ libxl_domain_build_info_init(b_info);
+ libxl_domain_build_info_copy(ctx, b_info, b_info_in);
+
rc = libxl__domain_build_info_setdefault(gc, b_info);
if (rc) goto out;
rc = 0;
out:
GC_FREE;
+ libxl_domain_build_info_dispose(b_info);
return rc;
}
*/
#define LIBXL_HAVE_CONST_COPY_AND_LENGTH_FUNCTIONS 1
+/* LIBXL_HAVE_DOMAIN_NEED_MEMORY_CONST_B_INFO
+ *
+ * If this is defined, libxl_domain_need_memory no longer modifies
+ * the b_info paseed in.
+ */
+#define LIBXL_HAVE_DOMAIN_NEED_MEMORY_CONST_B_INFO 1
+
/* LIBXL_HAVE_VNUMA
*
* If this is defined the type libxl_vnode_info exists, and a
* existing programs which use them in roughly the same way as libxl.
*/
/* how much free memory in the system a domain needs to be built */
-int libxl_domain_need_memory(libxl_ctx *ctx, libxl_domain_build_info *b_info,
+int libxl_domain_need_memory(libxl_ctx *ctx,
+ const libxl_domain_build_info *b_info_in,
uint32_t *need_memkb);
/* how much free memory is available in the system */
int libxl_get_free_memory(libxl_ctx *ctx, uint32_t *memkb);