From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3] dom variable error handled in Xenstore Date: Mon, 2 Nov 2015 12:03:53 +0000 Message-ID: <1446465833.3088.21.camel@citrix.com> References: <1445991143-9165-1-git-send-email-comethalley61@gmail.com> <1445994047.2937.238.camel@citrix.com> <20151029100728.GB8097@zion.uk.xensource.com> <1446113517.28782.50.camel@citrix.com> <1446215323.28782.120.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZtDqE-00038h-OK for xen-devel@lists.xenproject.org; Mon, 02 Nov 2015 12:04:02 +0000 In-Reply-To: <1446215323.28782.120.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: Dario Faggioli , Lasya Venneti Cc: xen-devel@lists.xenproject.org, Wei Liu , George Dunlap , Lars Kurth List-Id: xen-devel@lists.xenproject.org On Fri, 2015-10-30 at 15:28 +0100, Dario Faggioli wrote: > On Thu, 2015-10-29 at 20:28 +0530, Lasya Venneti wrote: > > > > > > On 29 October 2015 at 15:41, Dario Faggioli < > > dario.faggioli@citrix.com> wrote: > > > On Thu, 2015-10-29 at 10:07 +0000, Wei Liu wrote: > > > > > As for xc_dom_allocate, the only failure path at the moment is > > > malloc > > > > failure, which would be appropriate to use ENOMEM to represent. > > > > > > > > However if it causes too many faffs, you can just set rv to -1 > > > and > > > > return to caller. I think the main point is to handle the error, > > > > either > > > > -1 or ENOMEM is fine by me. > > > > > > > Agreed but, I personally prefer -1, for consistency. :-) > > > > > So should I proceed with -1? In that case I don't need to add the > > header... > > > If you're still up for this (and for the other patch, which would be > great!), yes, go for -1. Per my reply to v1 (still catching up on email backlog) yes, -1 is the correct thing to use here. ENOMEM is actively wrong. Ian.