From: Ian Campbell Subject: Re: [PATCH V5 29/32] xl: use "libxl-json" format Date: Mon, 2 Jun 2014 17:23:21 +0100 Message-ID: <1401726201.8841.20.camel@kazak.uk.xensource.com> References: <1400018054-26038-1-git-send-email-wei.liu2@citrix.com> <1400018054-26038-30-git-send-email-wei.liu2@citrix.com> <21371.28848.76400.435942@mariner.uk.xensource.com> <20140601190737.GE25584@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140601190737.GE25584@zion.uk.xensource.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: Wei Liu Cc: Ian Jackson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Sun, 2014-06-01 at 20:07 +0100, Wei Liu wrote: > On Tue, May 20, 2014 at 04:11:44PM +0100, Ian Jackson wrote: > > Wei Liu writes ("[PATCH V5 29/32] xl: use "libxl-json" format"): > > > Before this change, xl stores domain configuration in "xl" format, which > > > is in fact a verbatim copy of user supplied domain config. > > ... > > > + /* If we're doing migration, the domain name was appended with > > > + * "--incoming" a few lines above. So we need to remove that > > > + * suffix in the stored configuration. > > > + */ > > > + if (migrate_fd >= 0) { > > > + libxl_domain_config d; > > > + int xlen = strlen("--incoming"); > > > + int orig_len; > > > + > > > + ret = libxl_load_domain_configuration(ctx, domid, &d); > > > > Firstly, I think this editing of libxl's copy of domain config way is > > a layering violation. > > > > But it ought to be unnecessary, because either libxl_domain_rename > > or "libxl_load_domain_configuration" should deal with it. I would > > much prefer the latter, as that results in the domain name being > > stored only in one place. > > > > Huh? I suppose to avoid "layering violation" I should make > libxl_domain_rename manipulate the stored configuration, shouldn't I? > But you're suggesting I make libxl_load_domain_configuration work? > I'm confused. He was suggesting two alternatives, not two things to both be done. I think we need to decide if the stored configuration is the original user provide config, which is undated by libxl_retrieve_domain_configuration vs each libxl operation updating the stored state so that libxl_retrieve_domain_configuration before a simple parse and return. Ian.