Richard W.M. Jones
2022-Feb-17 22:00 UTC
[Libguestfs] [PATCH nbdkit v2 7/7] New filter: nbdkit-block-size-constraint-filter
On Thu, Feb 17, 2022 at 03:58:07PM -0600, Eric Blake wrote:> The NBD protocol spec recommends EINVAL (rather than EIO) for requests > that violate block size constraints. Do we want to hardcode EINVAL, > or else tweak the error policy to allow the user to specify which > errno to provide?I err on not overthinking this. I'll change it to EINVAL, and if ever we need to choose another errno then we can add a knob for it. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Eric Blake
2022-Feb-17 22:44 UTC
[Libguestfs] [PATCH nbdkit v2 7/7] New filter: nbdkit-block-size-constraint-filter
On Thu, Feb 17, 2022 at 10:00:52PM +0000, Richard W.M. Jones wrote:> On Thu, Feb 17, 2022 at 03:58:07PM -0600, Eric Blake wrote: > > The NBD protocol spec recommends EINVAL (rather than EIO) for requests > > that violate block size constraints. Do we want to hardcode EINVAL, > > or else tweak the error policy to allow the user to specify which > > errno to provide? > > I err on not overthinking this. I'll change it to EINVAL, and if ever > we need to choose another errno then we can add a knob for it.Just noticed this XXX comment that we should now be able to test with blocksize-policy of error: https://gitlab.com/nbdkit/libnbd/-/blob/master/tests/errors.c#L464 -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org