From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 14/14] libxl: Fix do_memory_op to return negative value on errors Date: Wed, 18 Mar 2015 16:39:53 +0000 Message-ID: <1426696793.14291.83.camel@citrix.com> References: <1426520383-20855-1-git-send-email-konrad.wilk@oracle.com> <1426520383-20855-15-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYHAW-0004BA-HK for xen-devel@lists.xenproject.org; Wed, 18 Mar 2015 16:50:08 +0000 In-Reply-To: <1426520383-20855-15-git-send-email-konrad.wilk@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 Mon, 2015-03-16 at 11:39 -0400, Konrad Rzeszutek Wilk wrote: > instead of the -Exx values (which should go in errno). > > This patch has HUGE implications. For such a small patch! > There is a lot of APIs > that are using do_memory_op. Fortunatly most of them "Fortunately". > check for 'if (do_memory_op(..) < 0)' so will function > properly. However there were some which printed the return > value to the user. They have been fixed in: > > libxl: Don't assign return value to errno for E820 get/set xc_ calls. > libxl: Check xc_sharing_* for proper return values. > libxl: Print xc_domain_decrease_reservation proper errno value. > libxl: If xc_domain_add_to_physmap fails, include errno value > libxl: Check xc_maximum_ram_page for negative return values. > libxl: Check xc_domain_maximum_gpfn for negative return values s/libxl/libxc/ in most of them. > Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Ian Campbell > --- > tools/libxc/xc_private.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c > index 0735e23..1222d05 100644 > --- a/tools/libxc/xc_private.c > +++ b/tools/libxc/xc_private.c > @@ -516,7 +516,7 @@ int do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len) > { > DECLARE_HYPERCALL; > DECLARE_HYPERCALL_BOUNCE(arg, len, XC_HYPERCALL_BUFFER_BOUNCE_BOTH); > - long ret = -EINVAL; > + long ret = -1; > > if ( xc_hypercall_bounce_pre(xch, arg) ) > {