From: Wei Liu Subject: Re: [PATCH v6] libxl_set_memory_target: retain the same maxmem offset on top of the current target Date: Mon, 2 Mar 2015 11:36:37 +0000 Message-ID: <20150302113637.GB11855@zion.uk.xensource.com> References: <1425041148-31034-1-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1425041148-31034-1-git-send-email-stefano.stabellini@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Ian.Jackson@eu.citrix.com, xen-devel@lists.xensource.com, wei.liu2@citrix.com, Ian.Campbell@citrix.com, dslutz@verizon.com List-Id: xen-devel@lists.xenproject.org On Fri, Feb 27, 2015 at 12:45:47PM +0000, Stefano Stabellini wrote: > In libxl_set_memory_target when setting the new maxmem, retain the same > offset on top of the current target. In the future the offset will > include memory allocated by QEMU for rom files. > Sorry for not having mentioned this earlier. I think the behaviour of this API is changed now (for good reason). Ian and Ian, do want need a #define in libxl.h to mark such change? > Signed-off-by: Stefano Stabellini > > --- > > Changes in v6: > - remove now useless xc_domaininfo_t info and xc_domain_getinfolist call. > > Changes in v5: > - call libxl_dominfo_init; > - move libxl_dominfo_dispose call before returning to the caller; > > Changes in v4: > - remove new_target_memkb <= 0 check. > > Changes in v3: > - move call to libxl__uuid2string and libxl_dominfo_dispose earlier; > - error out if new_target_memkb <= 0. > > Changes in v2: > - remove LIBXL_MAXMEM_CONSTANT from LIBXL__LOG_ERRNO. > --- > tools/libxl/libxl.c | 23 +++++++++-------------- > 1 file changed, 9 insertions(+), 14 deletions(-) > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > index b9a1941..b9d083a 100644 > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -4715,11 +4715,15 @@ int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, > uint32_t current_max_memkb = 0; > char *memmax, *endptr, *videoram_s = NULL, *target = NULL; > char *dompath = libxl__xs_get_dompath(gc, domid); > - xc_domaininfo_t info; > libxl_dominfo ptr; > char *uuid; > xs_transaction_t t; You missed libxl_domain_info_init. > > + if (libxl_domain_info(ctx, &ptr, domid) < 0) > + goto out_no_transaction; > + > + uuid = libxl__uuid2string(gc, ptr.uuid); > +