[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC 03/14] libxc: Fix xc_domain_get_tsc_info returning -Exx instead of -1.



On Fri, 2015-03-13 at 15:40 -0400, Konrad Rzeszutek Wilk wrote:
> On Fri, Mar 13, 2015 at 03:31:12PM -0400, Konrad Rzeszutek Wilk wrote:
> > Instead put the -Exx in errno.
> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> > ---
> >  tools/libxc/xc_domain.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
> > index 845d1d7..eb3a5f2 100644
> > --- a/tools/libxc/xc_domain.c
> > +++ b/tools/libxc/xc_domain.c
> > @@ -771,8 +771,10 @@ int xc_domain_get_tsc_info(xc_interface *xch,
> >  
> >      info = xc_hypercall_buffer_alloc(xch, info, sizeof(*info));
> >      if ( info == NULL )
> > -        return -ENOMEM;
> > -
> > +    {
> > +        errno = ENOMEM;
> > +        return -1;
> > +    }
> 
> While I was doing that I saw a lot of other code doing:
> 
> 
> if ( xc_hypercall_bounce_pre (..) )
>       return -1;
> 
> Should they all be fixed up to do:
>       'errno = ENOMEM'
> 
> before returning -1?

I think xc_hypercall_bounce_pre should probably set an appropriate errno
on failure rather than making all the callers have to think about it. It
may indirectly already do so via mmap? I didn't actually go look...


Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.