From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 05/14] libxl: xc_physdev_map return -1 and populate errno. Date: Wed, 18 Mar 2015 16:21:52 +0000 Message-ID: <1426695712.14291.68.camel@citrix.com> References: <1426520383-20855-1-git-send-email-konrad.wilk@oracle.com> <1426520383-20855-6-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYGjI-0007eC-6d for xen-devel@lists.xenproject.org; Wed, 18 Mar 2015 16:22:00 +0000 In-Reply-To: <1426520383-20855-6-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: > The users of these (qemu) check for a negative value > so we are safe in regards to that. However they > also use the return value to inform the user of the > error. IIRC I saw a qemu patch go past to fix the callers? > Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Ian Campbell > --- > tools/libxc/xc_physdev.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c > index cf02d85..9b064b8 100644 > --- a/tools/libxc/xc_physdev.c > +++ b/tools/libxc/xc_physdev.c > @@ -43,8 +43,10 @@ int xc_physdev_map_pirq(xc_interface *xch, > struct physdev_map_pirq map; > > if ( !pirq ) > - return -EINVAL; > - > + { > + errno = EINVAL; > + return -1; > + } > memset(&map, 0, sizeof(struct physdev_map_pirq)); > map.domid = domid; > map.type = MAP_PIRQ_TYPE_GSI; > @@ -72,8 +74,10 @@ int xc_physdev_map_pirq_msi(xc_interface *xch, > struct physdev_map_pirq map; > > if ( !pirq ) > - return -EINVAL; > - > + { > + errno = EINVAL; > + return -1; > + } > memset(&map, 0, sizeof(struct physdev_map_pirq)); > map.domid = domid; > map.type = MAP_PIRQ_TYPE_MSI;