From: Wei Liu Subject: Re: [PATCH for-4.5 1/2] libxl: continue when encounter ERROR_JSON_CONFIG_EMPTY Date: Mon, 17 Nov 2014 08:58:31 +0000 Message-ID: <20141117085831.GC11070@zion.uk.xensource.com> References: <1415811865-19981-1-git-send-email-wei.liu2@citrix.com> <1415811865-19981-2-git-send-email-wei.liu2@citrix.com> <1415962372.7113.2.camel@citrix.com> <1415962535.7113.4.camel@citrix.com> <20141114111051.GC31422@zion.uk.xensource.com> <1415963996.7113.11.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: <1415963996.7113.11.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, zhigang.x.wang@oracle.com, Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, Nov 14, 2014 at 11:19:56AM +0000, Ian Campbell wrote: > On Fri, 2014-11-14 at 11:10 +0000, Wei Liu wrote: > > On Fri, Nov 14, 2014 at 10:55:35AM +0000, Ian Campbell wrote: > > > On Fri, 2014-11-14 at 10:52 +0000, Ian Campbell wrote: > > > > On Wed, 2014-11-12 at 17:04 +0000, Wei Liu wrote: > > > > > Continue when libxl_retrieve_domain_configuration encounters > > > > > ERROR_JSON_CONFIG_EMPTY, as caller might be interested in the partial > > > > > configuration pulled from xenstore. In this case > > > > > ERROR_JSON_CONFIG_EMPTY is used as return value as before, if no other > > > > > error happens along the way. > > > > > > > > > > Signed-off-by: Wei Liu > > > > > Cc: Zhigang Wang > > > > > > > > Acked-by: Ian Campbell > > > > > > On second thoughts, I think this really needs an update to libxl.h to > > > describe the semantics of this function, i.e. to what extent the output > > > is valid for various error codes, especially ERROR_JSON_CONFIG_EMPTY. > > > > > > > Any non-zero return code means the output is invalid (as in "Is this > > output valid to rebuild a domain?"). > > But your second patch prints it as if it is at least somewhat > meaningful, if not entirely valid. According to what you just said it > shouldn't do so. > > You effectively have three return states now: Fully valid, domain exists > but it's configuration is unsure or somehow incomplete (~= JSON EMPTY), > some sort of error occurred. > > It might even be a good idea to have some new externally visible error > code for the middle state, since JSON_EMPTY may not be the only reason > for being in that state (at least in theory). > > Anyway, since this is all more subtle than the existing 0 is good, > non-zero is completely bad it should be written down. > I'm not very keen on rushing to get ERROR_JSON_CONFIG_EMPTY special meaning at this point of a release. I think we can deal with this in next release. Wei. > Ian.