From: Ian Campbell Subject: Re: [PATCH] make domain_create() return a proper error code Date: Mon, 3 Sep 2012 09:47:36 +0100 Message-ID: <1346662056.27277.250.camel@zakaz.uk.xensource.com> References: <504470FD0200007800098213@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <504470FD0200007800098213@nat28.tlf.novell.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: Jan Beulich Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On Mon, 2012-09-03 at 07:57 +0100, Jan Beulich wrote: > While triggered by the XSA-9 fix, this really is of more general use; > that fix just pointed out very sharply that the current situation > with all domain creation failures reported to user (tools) space as > -ENOMEM is very unfortunate (actively misleading users _and_ support > personnel). > > Pull over the pointer <-> error code conversion infrastructure from > Linux, and use it in domain_create() and all it callers. > > Signed-off-by: Jan Beulich > > --- a/xen/arch/arm/setup.c > +++ b/xen/arch/arm/setup.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -237,7 +238,7 @@ void __init start_xen(unsigned long boot > > /* Create initial domain 0. */ > dom0 = domain_create(0, 0, 0); > - if ( dom0 == NULL ) > + if ( IS_ERR(dom0) ) > printk("domain_create failed\n"); > if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) ) You probably wanted to change this one too? I'm not sure the first message really buys much -- I'd be happy to nuke it too. Ian.