On Mon, Jun 17, 2019 at 07:07:55PM -0500, Eric Blake wrote:
+ errno = nbd_internal_errno_of_nbd_error (error);
+ set_error (errno, "server reported read failure at offset 0x%"
PRIx64,
+ offset);
+ if (cmd->cb.fn.read (cmd->cb.opaque, cmd->data + (offset -
cmd->offset),
+ 0, offset, LIBNBD_READ_ERROR) == -1)
I understand that in the next commit the pread_callback callback
function is meant to read errno implicitly, and this is why you are
setting it before calling that callback here. However I don't
understand why you didn't just pass this in as an extra (ie. explicit)
parameter? As currently defined this will not work well in non-C
languages, because the generator and indeed those languages know
nothing about errno.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages.
http://libguestfs.org