From: Ian Campbell Subject: Re: [PATCH] make domain_create() return a proper error code Date: Mon, 3 Sep 2012 10:06:14 +0100 Message-ID: <1346663174.27277.252.camel@zakaz.uk.xensource.com> References: <504470FD0200007800098213@nat28.tlf.novell.com> <1346662056.27277.250.camel@zakaz.uk.xensource.com> <50448D6A020000780009831B@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50448D6A020000780009831B@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 09:58 +0100, Jan Beulich wrote: > >>> On 03.09.12 at 10:47, Ian Campbell wrote: > > 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? > > Oh, indeed. I blindly implied the printk() there would be a > panic() already. > > > I'm not sure the first message really buys much -- I'd be happy to nuke > > it too. > > Yes, I would be in favor of that. Will you do the adjustment, > or shall I submit an incremental patch? I've posted a patch, I think it and your mail probably crossed in the air...