All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	andrew.cooper3@citrix.com,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Ross Lagerwall <ross.lagerwall@citrix.com>,
	JBeulich@suse.com, xen-devel@lists.xenproject.org
Subject: Re: Returning errno values inside of hypercall structs (was: Re: [PATCH for-4.7 3/4] tools/xsplice: fix mixing system)
Date: Fri, 29 Apr 2016 13:25:43 -0400	[thread overview]
Message-ID: <20160429172543.GD4695@char.us.oracle.com> (raw)
In-Reply-To: <20160429170744.6lhcrqa73q5j6rki@mac>

On Fri, Apr 29, 2016 at 07:07:44PM +0200, Roger Pau Monne wrote:
> On Fri, Apr 29, 2016 at 12:59:30PM -0400, Konrad Rzeszutek Wilk wrote:
> > > > > IMHO, the best way to solve this is to define a set of XSPLICE_ERROR_* that 
> > > > > covers the error codes returned by xsplice, and use that instead of XEN_* 
> > > > > errno values. This would make it much more easier to avoid mistakes when 
> > > > > coding the toolstack part of xsplice.
> > > > 
> > > > But why?
> > > > 
> > > > I must be missing something here - but the return from the hypercall
> > > > can return say 0 but the status->rc can be -XEN_EAGAIN.
> > > > 
> > > > Why does it need to be XSPLICE_ERROR_?
> > > 
> > > Because nobody uses or enforces the correct usage of XEN_E* in the tools, so 
> > > people just use native error codes, which works on Linux, but breaks on 
> > > other OSes.
> > 
> > That was an oversigh on my part. I think changing the error code handling
> > in xen-xsplice to look for XEN_EXX is the right way.
> > 
> > But are you saying the BSD does not enforce the POSIX errors? errno.h is POSIX right?
> 
> Yes, BSD uses POSIX error codes just as Linux, the issue is that the values 
> differ. For example on Xen and Linux EAGAIN is 11, on FreeBSD EAGAIN is 35.

Wow! That is messed up. And would explain the odd errors you had seen.

But if the xen-xsplice would use XEN_EXX error handling this would work for you right?
(Which BTW, thank you for doing!)

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

  reply	other threads:[~2016-04-29 17:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29 16:16 Returning errno values inside of hypercall structs (was: Re: [PATCH for-4.7 3/4] tools/xsplice: fix mixing system) Roger Pau Monne
2016-04-29 16:22 ` Konrad Rzeszutek Wilk
2016-04-29 16:31   ` Roger Pau Monne
2016-04-29 16:59     ` Konrad Rzeszutek Wilk
2016-04-29 17:07       ` Roger Pau Monne
2016-04-29 17:25         ` Konrad Rzeszutek Wilk [this message]
2016-04-29 16:26 ` Jan Beulich
2016-05-03 10:49 ` David Vrabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160429172543.GD4695@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.