From: Wei Liu Subject: Re: [PATCH v2 15/18] libxl: introduce libxl_retrieve_domain_configuration Date: Thu, 28 Aug 2014 12:39:20 +0100 Message-ID: <20140828113920.GM13165@zion.uk.xensource.com> References: <1406744639-28782-1-git-send-email-wei.liu2@citrix.com> <1406744639-28782-16-git-send-email-wei.liu2@citrix.com> <1409105632.28009.80.camel@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: <1409105632.28009.80.camel@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: Ian Campbell Cc: ian.jackson@eu.citrix.com, Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Aug 27, 2014 at 03:13:52AM +0100, Ian Campbell wrote: > On Wed, 2014-07-30 at 19:23 +0100, Wei Liu wrote: > > + /* Domain name */ > > > + /* Domain UUID */ > > Wasn't there a new libxl__update_domain_configuration which does a bunch > of this for you already? > It updates UUID in JSON config but not domain name. I would still prefer to use xenstore as primary reference for information like domain name and UUID etc. > > + /* "target" */ > > + rc = libxl_get_memory_target(ctx, domid, &memory); > > + if (rc) { > > + LOG(ERROR, "fail to get memory target for domain %d", domid); > > + goto out; > > + } > > + /* If the domain is HVM domain, target memory in xenstore is > > + * smaller than what user has asked for. The difference is > > + * video_memkb, so add it back. Otherwise domain rebuild will > > + * fail. > > Ahem, lovely. Could you add a note at the point on creation where the > opposite happens pointing here for the benefit of anyone who touched > it... > Sure, I will see what I can do. > > + */ > > + if (d_config->b_info.type == LIBXL_DOMAIN_TYPE_HVM) > > + d_config->b_info.target_memkb = > > + memory + d_config->b_info.video_memkb; > > + > > + /* "static-max" */ > > + rc = libxl_get_memory_static_max(ctx, domid, &memory); > > This and the libxl_get_memory_target are implemented in terms of a very > handy internal helper that you added which returns both at the same > time ;-) > Yes I can use that internal function to do this. Wei. > Ian.