[PATCH] libxl: Make domain build xc_domain_setmaxmem() call use max_memkb

Kevin Alarcon Negy posted 1 patch 10 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/e7ab0b64b8dce1ca5b71b3f75f7bce6d4824d2ed.1687881417.git.kevin@exostellar.io
There is a newer version of this series
tools/libs/light/libxl_dom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] libxl: Make domain build xc_domain_setmaxmem() call use max_memkb
Posted by Kevin Alarcon Negy 10 months, 1 week ago
When building a domain, xc_domain_setmaxmem() is called with target_memkb (memory in domain config file).
If a config specifies maxmem > memory, any attempts to increase the domain memory size to its max,
outside of xl mem-set or xl mem-max, which already call xc_domain_setmaxmem() properly, will fail.
Changed xc_domain_setmaxmem() call inside libxl__build_pre() to use max_memkb.

Signed-off-by: Kevin Alarcon Negy <kevin@exostellar.io>
---
 tools/libs/light/libxl_dom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
index 94fef37401..16aa255aad 100644
--- a/tools/libs/light/libxl_dom.c
+++ b/tools/libs/light/libxl_dom.c
@@ -355,7 +355,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
         return ERROR_FAIL;
     }
 
-    if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + size) < 0) {
+    if (xc_domain_setmaxmem(ctx->xch, domid, info->max_memkb + size) < 0) {
         LOGE(ERROR, "Couldn't set max memory");
         return ERROR_FAIL;
     }
-- 
2.25.1