From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] libxl: create PVH guests with max memory assigned Date: Fri, 18 Jul 2014 12:49:24 -0400 Message-ID: <20140718164924.GA9514@laptop.dumpdata.com> References: <1405594942-20760-1-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X8BLl-0002VO-7F for xen-devel@lists.xenproject.org; Fri, 18 Jul 2014 16:49:37 +0000 Content-Disposition: inline In-Reply-To: <1405594942-20760-1-git-send-email-roger.pau@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: Roger Pau Monne Cc: xen-devel@lists.xenproject.org, Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org On Thu, Jul 17, 2014 at 01:02:22PM +0200, Roger Pau Monne wrote: > Since PVH guests are very similar to HVM guests in terms of memory > management, start the guest with the maximum memory assigned and let > it balloon down. There is something odd about your email. When I look at in mutt I see the patch, but if I save it and try do git am it complains. Looking at the file I see: U2luY2UgUFZIIGd1ZXN0cyBhcmUgdmVyeSBzaW1pbGFyIHRvIEhWTSBndWVzdHMgaW4gdG= VybXMg b2YgbWVtb3J5Cm1hbmFnZW1lbnQsIHN0YXJ0IHRoZSBndWVzdCB3aXRoIHRoZSBtYXhpbX= VtIG1l bW9yeSBhc3NpZ25lZCBhbmQgbGV0Cml0IGJhbGxvb24gZG93bi4KClNpZ25lZC1vZmYtYn= k6IFJv Z2VyIFBhdSBNb25uw6kgPHJvZ2VyLnBhdUBjaXRyaXguY29tPgpDYzogSWFuIEphY2tzb2= 4gPGlh bi5qYWNrc29uQGV1LmNpdHJpeC5jb20+CkNjOiBJYW4gQ2FtcGJlbGwgPGlhbi5jYW1wYm= VsbEBj aXRyaXguY29tPgpDYzogTXVrZXNoIFJhdGhvciA8bXVrZXNoLnJhdGhvckBvcmFjbGUuY2= 9tPgot .. and so. Have you changed something recently in your git sendmail setup? Thanks. > = > Signed-off-by: Roger Pau Monn=E9 > Cc: Ian Jackson > Cc: Ian Campbell > Cc: Mukesh Rathor > --- > tools/libxl/libxl_dom.c | 13 ++++++++++--- > 1 files changed, 10 insertions(+), 3 deletions(-) > = > diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c > index 661999c..eada87d 100644 > --- a/tools/libxl/libxl_dom.c > +++ b/tools/libxl/libxl_dom.c > @@ -233,6 +233,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, > libxl_domain_build_info *const info =3D &d_config->b_info; > libxl_ctx *ctx =3D libxl__gc_owner(gc); > char *xs_domid, *con_domid; > + unsigned long mem; > int rc; > = > if (xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus) !=3D 0) { > @@ -263,8 +264,12 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, > libxl_domain_set_nodeaffinity(ctx, domid, &info->nodemap); > libxl_set_vcpuaffinity_all(ctx, domid, info->max_vcpus, &info->cpuma= p); > = > - if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + > - LIBXL_MAXMEM_CONSTANT) < 0) { > + if (info->type =3D=3D LIBXL_DOMAIN_TYPE_PV) > + mem =3D libxl_defbool_val(d_config->c_info.pvh) ? info->max_memk= b : > + info->target_mem= kb; > + else > + mem =3D info->target_memkb; > + if (xc_domain_setmaxmem(ctx->xch, domid, mem + LIBXL_MAXMEM_CONSTANT= ) < 0) { > LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't set max memory= "); > return ERROR_FAIL; > } > @@ -370,6 +375,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid, > { > libxl_ctx *ctx =3D libxl__gc_owner(gc); > struct xc_dom_image *dom; > + unsigned long mem; > int ret; > int flags =3D 0; > = > @@ -440,7 +446,8 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid, > LOGE(ERROR, "libxl__arch_domain_init_hw_description failed"); > goto out; > } > - if ( (ret =3D xc_dom_mem_init(dom, info->target_memkb / 1024)) !=3D = 0 ) { > + mem =3D state->pvh_enabled ? info->max_memkb : info->target_memkb; > + if ( (ret =3D xc_dom_mem_init(dom, mem / 1024)) !=3D 0 ) { > LOGE(ERROR, "xc_dom_mem_init failed"); > goto out; > } > -- = > 1.7.7.5 (Apple Git-26) > = > = > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel