From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 05/14] libxl: xc_physdev_map return -1 and populate errno. Date: Wed, 18 Mar 2015 12:29:54 -0400 Message-ID: <20150318162939.GA17062@x230.dumpdata.com> References: <1426520383-20855-1-git-send-email-konrad.wilk@oracle.com> <1426520383-20855-6-git-send-email-konrad.wilk@oracle.com> <1426695712.14291.68.camel@citrix.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 1YYGrC-0008Sy-Uv for xen-devel@lists.xenproject.org; Wed, 18 Mar 2015 16:30:11 +0000 Content-Disposition: inline In-Reply-To: <1426695712.14291.68.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: Ian Campbell 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, Mar 18, 2015 at 04:21:52PM +0000, Ian Campbell wrote: > 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? > Yes and Stefano has already Acked them. > > Signed-off-by: Konrad Rzeszutek Wilk > > Acked-by: Ian Campbell Yeey! > > > --- > > 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; > >