From: Ian Campbell Subject: Re: [PATCH V5 29/32] xl: use "libxl-json" format Date: Mon, 2 Jun 2014 17:30:23 +0100 Message-ID: <1401726623.8841.22.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> <1400595806.6946.85.camel@kazak.uk.xensource.com> <20140601193718.GG25584@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140601193718.GG25584@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@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Sun, 2014-06-01 at 20:37 +0100, Wei Liu wrote: > On Tue, May 20, 2014 at 03:23:26PM +0100, Ian Campbell wrote: > [...] > > > @@ -1787,13 +1770,10 @@ static int handle_domain_death(uint32_t *r_domid, > > > break; > > > > > > case LIBXL_ACTION_ON_SHUTDOWN_RESTART_RENAME: > > > - reload_domain_config(*r_domid, config_data, config_len); > > > restart = 2; > > > break; > > > > > > case LIBXL_ACTION_ON_SHUTDOWN_RESTART: > > > - reload_domain_config(*r_domid, config_data, config_len); > > > > Why is it not equally necessary to reload the JSON config at this point > > if it exists? > > > > Because domain configuration is loaded in the caller of > handle_domain_death now. OK. Is there any way that could be refactored into a separate patch to make this one simpler to reason about? > > Or should we not be updating the domain config as we do the renaming at > > the end? > > > > I agree that libxl_domain_rename is a better place to update stored > domain name. We should probably all agree on which of the approachs we want to use before you refactor (there is more than one subthread suggesting various ways...) > > > > > @@ -3102,22 +3119,18 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain) > > > s = yajl_gen_status_ok; > > > > > > for (i = 0; i < nb_domain; i++) { > > > + libxl_domain_config_init(&d_config); > > > /* no detailed info available on dom0 */ > > > if (info[i].domid == 0) > > > continue; > > > - rc = libxl_userdata_retrieve(ctx, info[i].domid, "xl", &data, &len); > > > + rc = libxl_load_domain_configuration(ctx, info[i].domid, &d_config); > > > > If a domain was created with xl.old will we not now fail to list details > > of it here? > > > > Don't you need to restart if you install new tool? Is this a valid > usecase? Yes, that's true. I had my lazy developer non-rebooting hat on ;-) Ian.