[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] tools/libs/light: update xenstore entry when setting max domain memory
On Thu, Mar 31, 2022 at 09:07:55AM +0200, Juergen Gross wrote: > libxl_domain_setmaxmem() should update the domain's memory/static-max > Xenstore node, as otherwise "xl mem-set" won't be able to set the > memory size to the new maximum. `xl mem-set` doesn't call libxl_domain_setmaxmem(), but calls libxl_set_memory_target(). Or maybe you are speaking about `xl mem-max` followed by `xl mem-set`? In this case, it is documented in `man 1 xl` that `mem-max` has no effect to `mem-set`. quote from man, about `xl mem-max`: It is allowed to be higher than the configured maximum memory size of the domain (B<maxmem> parameter in the domain's configuration). Note however that the initial B<maxmem> value is still used as an upper limit for B<xl mem-set>. Also note that calling B<xl mem-set> will reset this value. > Signed-off-by: Juergen Gross <jgross@xxxxxxxx> > --- > tools/libs/light/libxl_mem.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/tools/libs/light/libxl_mem.c b/tools/libs/light/libxl_mem.c > index c739d00f39..2f4f9d4a4a 100644 > --- a/tools/libs/light/libxl_mem.c > +++ b/tools/libs/light/libxl_mem.c > @@ -82,6 +82,15 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, > uint64_t max_memkb) There's a comment on this functions: /* * Set the maximum memory size of the domain in the hypervisor. There is no * change of the current memory size involved. The specified memory size can * even be above the configured maxmem size of the domain, but the related * Xenstore entry memory/static-max isn't modified! */ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint64_t max_memkb) So it was already known that "static-max" wasn't set. At the very least, this comment needs updating. > goto out; > } > > + rc = libxl__xs_printf(gc, XBT_NULL, > + GCSPRINTF("%s/memory/static-max", dompath), > + "%"PRIu64, max_memkb); > + if (rc != 0) { > + LOGED(ERROR, domid, "Couldn't set %s/memory/static-max, rc=%d\n", > + dompath, rc); > + goto out; So, I don't know whether increasing "static-max" is fine or not, but according to the documentation, it isn't expected. Is a guest fine with "static-max" been changed? If yes, there's documentation and comments that needs to change with the code change. Thanks, -- Anthony PERARD
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |