* errno i xs_wire.h
@ 2005-11-08 12:04 Jacob Gorm Hansen
2005-11-08 12:20 ` harry
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jacob Gorm Hansen @ 2005-11-08 12:04 UTC (permalink / raw)
To: xen-devel
hi,
playing with xenbus support in mini-os, I noticed that xs_wire.h
references errno constants such as EINVAL. Is the use of these
constants (which could be guest-OS specific) in the wire-protocol not
problematic? Should xs_wire.h define its own set of constants to be
used instead?
Jacob
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: errno i xs_wire.h
2005-11-08 12:04 errno i xs_wire.h Jacob Gorm Hansen
@ 2005-11-08 12:20 ` harry
2005-11-08 12:22 ` Ewan Mellor
2005-11-08 13:25 ` Mark Williamson
2 siblings, 0 replies; 8+ messages in thread
From: harry @ 2005-11-08 12:20 UTC (permalink / raw)
To: Jacob Gorm Hansen; +Cc: xen-devel
Yes, I think it is problematic. In the xenidc code for the USB driver I
have a platform independent error type and functions to convert between
local and wire protocol error values.
On Tue, 2005-11-08 at 13:04 +0100, Jacob Gorm Hansen wrote:
> hi,
>
> playing with xenbus support in mini-os, I noticed that xs_wire.h
> references errno constants such as EINVAL. Is the use of these
> constants (which could be guest-OS specific) in the wire-protocol not
> problematic? Should xs_wire.h define its own set of constants to be
> used instead?
>
> Jacob
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: errno i xs_wire.h
2005-11-08 12:04 errno i xs_wire.h Jacob Gorm Hansen
2005-11-08 12:20 ` harry
@ 2005-11-08 12:22 ` Ewan Mellor
2005-11-08 13:25 ` Mark Williamson
2 siblings, 0 replies; 8+ messages in thread
From: Ewan Mellor @ 2005-11-08 12:22 UTC (permalink / raw)
To: Jacob Gorm Hansen; +Cc: xen-devel
On Tue, Nov 08, 2005 at 01:04:33PM +0100, Jacob Gorm Hansen wrote:
> hi,
>
> playing with xenbus support in mini-os, I noticed that xs_wire.h
> references errno constants such as EINVAL. Is the use of these
> constants (which could be guest-OS specific) in the wire-protocol not
> problematic? Should xs_wire.h define its own set of constants to be
> used instead?
I believe that xsd_errors is a translation table between your EINVAL integer
code and the string "EINVAL", for use on the wire. That means that the table
is correct to use the integer code appropriate to your platform.
Ewan.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: errno i xs_wire.h
2005-11-08 12:04 errno i xs_wire.h Jacob Gorm Hansen
2005-11-08 12:20 ` harry
2005-11-08 12:22 ` Ewan Mellor
@ 2005-11-08 13:25 ` Mark Williamson
2005-11-08 13:38 ` harry
2005-11-08 18:26 ` Oleg Goldshmidt
2 siblings, 2 replies; 8+ messages in thread
From: Mark Williamson @ 2005-11-08 13:25 UTC (permalink / raw)
To: xen-devel; +Cc: Jacob Gorm Hansen
> playing with xenbus support in mini-os, I noticed that xs_wire.h
> references errno constants such as EINVAL. Is the use of these
> constants (which could be guest-OS specific)
Isn't the basic set of errno vals posix standardised? So even if a guest OS
doesn't deal in errnos itself, it can just import the BSD errno.h or
similar...?
Cheers,
Mark
> in the wire-protocol not
> problematic? Should xs_wire.h define its own set of constants to be
> used instead?
>
> Jacob
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: errno i xs_wire.h
2005-11-08 13:25 ` Mark Williamson
@ 2005-11-08 13:38 ` harry
2005-11-08 18:26 ` Oleg Goldshmidt
1 sibling, 0 replies; 8+ messages in thread
From: harry @ 2005-11-08 13:38 UTC (permalink / raw)
To: Mark Williamson; +Cc: xen-devel, Jacob Gorm Hansen
I was talking with Rusty about this and apparently posix doesn't
actually standardise the numbers.
On Tue, 2005-11-08 at 13:25 +0000, Mark Williamson wrote:
> > playing with xenbus support in mini-os, I noticed that xs_wire.h
> > references errno constants such as EINVAL. Is the use of these
> > constants (which could be guest-OS specific)
>
> Isn't the basic set of errno vals posix standardised? So even if a guest OS
> doesn't deal in errnos itself, it can just import the BSD errno.h or
> similar...?
>
> Cheers,
> Mark
>
> > in the wire-protocol not
> > problematic? Should xs_wire.h define its own set of constants to be
> > used instead?
> >
> > Jacob
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: errno i xs_wire.h
2005-11-08 13:25 ` Mark Williamson
2005-11-08 13:38 ` harry
@ 2005-11-08 18:26 ` Oleg Goldshmidt
1 sibling, 0 replies; 8+ messages in thread
From: Oleg Goldshmidt @ 2005-11-08 18:26 UTC (permalink / raw)
To: Mark Williamson; +Cc: xen-devel, Jacob Gorm Hansen
Mark Williamson <mark.williamson@cl.cam.ac.uk> writes:
> > playing with xenbus support in mini-os, I noticed that xs_wire.h
> > references errno constants such as EINVAL. Is the use of these
> > constants (which could be guest-OS specific)
>
> Isn't the basic set of errno vals posix standardised? So even if a guest OS
> doesn't deal in errnos itself, it can just import the BSD errno.h or
> similar...?
POSIX does not standardise errno *values*. It only specifies a set of
symbolic error names and their meanings, and says that all the POSIX
symbolic error names must have distinct values.
So if you need to share the values between entities that may have
different error name/value mappings (even if everybody is
POSIX-compliant) you need a conversion protocol.
I suppose "man errno" will give you the set of POSIX error names.
--
Oleg Goldshmidt | pub@NOSPAM.goldshmidt.org | http://www.goldshmidt.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: errno i xs_wire.h
@ 2005-11-08 21:59 Everhart, Craig
2005-11-09 12:06 ` Keir Fraser
0 siblings, 1 reply; 8+ messages in thread
From: Everhart, Craig @ 2005-11-08 21:59 UTC (permalink / raw)
To: xen-devel
Yes, trusting that different OS's will map errno names to the same
integers is asking for trouble. Doing it right means translating
the values between domains. Harry had it right with "local" and
"wire" error values, translating between them.
There's overlap in the mappings, particularly for some of the
smallest error values, but it's best not to be seduced by
the overlap into assuming it continues.
Craig
> -----Original Message-----
> From: Oleg Goldshmidt [mailto:pub@goldshmidt.org]
> Sent: Tuesday, November 08, 2005 1:26 PM
> To: Mark Williamson
> Cc: xen-devel@lists.xensource.com; Jacob Gorm Hansen
> Subject: Re: [Xen-devel] errno i xs_wire.h
>
> Mark Williamson <mark.williamson@cl.cam.ac.uk> writes:
>
> > > playing with xenbus support in mini-os, I noticed that xs_wire.h
> > > references errno constants such as EINVAL. Is the use of these
> > > constants (which could be guest-OS specific)
> >
> > Isn't the basic set of errno vals posix standardised? So even if a
> > guest OS doesn't deal in errnos itself, it can just import the BSD
> > errno.h or similar...?
>
> POSIX does not standardise errno *values*. It only specifies
> a set of symbolic error names and their meanings, and says
> that all the POSIX symbolic error names must have distinct values.
>
> So if you need to share the values between entities that may
> have different error name/value mappings (even if everybody is
> POSIX-compliant) you need a conversion protocol.
>
> I suppose "man errno" will give you the set of POSIX error names.
>
> --
> Oleg Goldshmidt | pub@NOSPAM.goldshmidt.org |
> http://www.goldshmidt.org
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: errno i xs_wire.h
2005-11-08 21:59 Everhart, Craig
@ 2005-11-09 12:06 ` Keir Fraser
0 siblings, 0 replies; 8+ messages in thread
From: Keir Fraser @ 2005-11-09 12:06 UTC (permalink / raw)
To: Everhart, Craig; +Cc: xen-devel
On 8 Nov 2005, at 21:59, Everhart, Craig wrote:
> Yes, trusting that different OS's will map errno names to the same
> integers is asking for trouble. Doing it right means translating
> the values between domains. Harry had it right with "local" and
> "wire" error values, translating between them.
>
> There's overlap in the mappings, particularly for some of the
> smallest error values, but it's best not to be seduced by
> the overlap into assuming it continues.
We already have the distinction. We use text strings on the wire which
are converted to/from local errno numbers at either end.
-- Keir
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-11-09 12:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-08 12:04 errno i xs_wire.h Jacob Gorm Hansen
2005-11-08 12:20 ` harry
2005-11-08 12:22 ` Ewan Mellor
2005-11-08 13:25 ` Mark Williamson
2005-11-08 13:38 ` harry
2005-11-08 18:26 ` Oleg Goldshmidt
-- strict thread matches above, loose matches on Subject: below --
2005-11-08 21:59 Everhart, Craig
2005-11-09 12:06 ` Keir Fraser
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.