On 01/26/2017 09:16 AM, Richard W.M. Jones wrote:
It sounds like errno_is_reliable is an unknowable value. How would
we
set it correctly for Perl (for example), in a way that would work for
all past and future Perl interpreters?
errno is NEVER reliable after a non-C plugin, so we have a knowable
value. So for perl, we set it (in plugins/perl/perl.c) to always return
false, and don't ever provide a way for non-C languages to overwrite
this particular callback. The callback is only useful for C, and even
then, omitting the callback behaves sanely for existing C plugins
(because the only place we really need to implement it is in our four
language binding C glue files). Thus, we'd be changing behavior of
existing perl plugins, but the change is that any errors reported across
the wire used to be random error values (whatever errno ended up as
after perl binding glue finished) and is now going to consistently be
EIO - at least until I figure out how to wire up nbdkit_set_error to be
callable from perl, and a perl plugin is updated to honor that.
It looks like v2 will be fine, no need to respin ...
I still think it's worth me posting v3 before you commit the second half
of this series.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org