On 4/24/19 6:04 AM, Richard W.M. Jones wrote:
errno is currently set to a suitable value if nbdkit_extents_new
returns an error, but this was not documented so I added that
documentation.
Set errno to a suitable value if nbdkit_add_extent returns an error,
and also document that.
Thanks: Eric Blake for spotting the problem.
---
docs/nbdkit-filter.pod | 3 ++-
docs/nbdkit-plugin.pod | 2 +-
server/extents.c | 2 ++
3 files changed, 5 insertions(+), 2 deletions(-)
+++ b/server/extents.c
@@ -154,6 +154,7 @@ nbdkit_add_extent (struct nbdkit_extents *exts,
nbdkit_error ("nbdkit_add_extent: "
"extents must be added in ascending order and "
"must be contiguous");
+ errno = ERANGE;
return -1;
ERANGE can't be sent over the wire to the client (we end up sending
NBD_EINVAL instead), but it is the best choice for server-side logging
when diagnosing the problem. ACK.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization:
qemu.org |
libvirt.org