From: Ian Campbell Subject: Re: [PATCH] libxl: Make an internal function explicitly check existence of expected paths Date: Tue, 27 Nov 2012 11:55:59 +0000 Message-ID: <1354017359.17985.23.camel@zakaz.uk.xensource.com> References: <85552b648b3cabebd4f5.1353686197@elijah> <1354016648.17985.13.camel@zakaz.uk.xensource.com> <50B4A8F7.5050702@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50B4A8F7.5050702@eu.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: George Dunlap Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Tue, 2012-11-27 at 11:50 +0000, George Dunlap wrote: > On 27/11/12 11:44, Ian Campbell wrote: > > On Fri, 2012-11-23 at 15:56 +0000, George Dunlap wrote: > >> + LIBXL__LOG(ctx, LIBXL__LOG_ERROR, > >> + "Internal error: Missing xenstore node %s/removable", be_path); > > > > One or two of these new log lines are > 80 columns. You might find that > > using the shorthand LOG*() macros helps with this. > > Oops -- I'll fix that up. > > > > > Personally I don't think the "Internal error" tag is necessary either, > > but maybe a new return code ERROR_INTERNAL might make sense? or even an > > assert() if this is really a "libxl failed to maintain internal > > consistency" ? > > The idea behind the "Internal" tag is to tell users, "Unless you've been > manually messing around with xenstore removing nodes, this is definitely > not your fault." OK. Perhaps in order to do this consistently we could have a libxl helper which logs a message with this tag added and then aborts? (libxl_assert?) Might be worth leaving some time for others to weigh in before implementing that though, since adding aborts is something which might be considered controversial. > I guess normally an ASSERT communicates that pretty well, but I guess > I'm used to ASSERTs that disappear when DEBUG is turned off. :-) Is > that not the case for libxl? I don't think assert(3) has this property? Ian.