From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 08/14] libxl: Fix xc_tmem_control to return proper error. Date: Thu, 19 Mar 2015 10:26:14 +0000 Message-ID: <1426760774.610.10.camel@citrix.com> References: <1426520383-20855-1-git-send-email-konrad.wilk@oracle.com> <1426520383-20855-9-git-send-email-konrad.wilk@oracle.com> <1426695997.14291.72.camel@citrix.com> <20150318173715.GB25199@l.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYXf1-0001wL-2w for xen-devel@lists.xenproject.org; Thu, 19 Mar 2015 10:26:43 +0000 In-Reply-To: <20150318173715.GB25199@l.oracle.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: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com, wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, 2015-03-18 at 13:37 -0400, Konrad Rzeszutek Wilk wrote: > > Or alternatively fix the return type of xc_tmem_control. > > > > > - > > > + node->freeable_mb = (rc < 0) ? 0 : rc; > > > > Should rc not get propagated into an error for the caller? > > Nope. If tmem is not enabled (so xc_tmem_control returns -ENOSYS) I think after these changes you mean returns -1 with errno == -ENOSYS? > freeable_mb should be zero. In this case we would have returned negative > values which is certainly not right. What about other possible error codes from xc_tmem_control? At the least it appears it can return with errno=ENOMEM (from the hypercall buffer usage). Ian.