From: Wei Liu Subject: Re: [PATCH v1 01/10] libxl: libxl-json format and internal functions to get / set it Date: Fri, 25 Jul 2014 11:30:05 +0100 Message-ID: <20140725103005.GH28444@zion.uk.xensource.com> References: <1405002745-5034-1-git-send-email-wei.liu2@citrix.com> <1405002745-5034-2-git-send-email-wei.liu2@citrix.com> <21457.20646.331945.575724@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <21457.20646.331945.575724@mariner.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: Ian Jackson Cc: Wei Liu , ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, Jul 24, 2014 at 07:29:58PM +0100, Ian Jackson wrote: > Wei Liu writes ("[PATCH v1 01/10] libxl: libxl-json format and internal functions to get / set it"): > > Introduce a new format in libxl userdata store called "libxl-json". This > > file format contains JSON version of libxl_domain_config, generated by > > libxl. > ... > > +int libxl__get_domain_configuration(libxl__gc *gc, uint32_t domid, > > + libxl_domain_config *d_config) > > +{ > > + uint8_t *data = NULL; > > + int rc, len; > > + > > + rc = libxl_userdata_retrieve(CTX, domid, "libxl-json", &data, &len); > ... > > + if (len == 0) { > > + LOGE(ERROR, "configuration data stream empty for domain %d", domid); > > + rc = ERROR_FAIL; > > Reading 03/10 I notice the following issue with this: > > During domain setup there is a moment where the domid exists, but the > configuration data doesn't. Therefore this is a possible situation, > and does not reflect an internal error. > > So, you need to treat this case differently. It shouldn't log an > error and it should probably return a custom error code, which all > callers would have to handle specially. > > Ultimately if an application asks for the configuration of a domain in > this state, it is not possible to tell whether it is in the process > being created, or is left in an anomalous (crashed) state. So I think > this possible but anomalous state needs to be exposed all the way up > the stack. > No problem. I can return ERROR_JSON_CONFIG_EMPTY. Does this patch still have your ack provided I make that change? Wei. > Ian.