We have been inconsistent on how much we reject client-side without
even consulting the server, vs. how much we depend on the server to
detect failure (even if our request can be deemed undefined per NBD
protocol). I'd like to change it so that by default, we reject as
much as we can client-side for less traffic, but where the user can
also change things on the fly for server-side integration testing.
My remaining question, then, is how many knobs to expose initially?
As written, I've only given two knobs, but make the case in each patch
how it could easily be split into four knobs if we think the finer
granularity is worthwhile.
A future knob for block-size validation would also make sense,
especially given the recent addition of support for querying server
minimum block size constraints (although I'd like to finish my work on
getting nbdkit to advertise block constraints to make that easier to
test...).
Eric Blake (2):
api: Add nbd_set_strict_mode
api: Add STRICT_BOUNDS to nbd_set_strict_mode
lib/internal.h | 3 +
generator/API.ml | 67 ++++++++++-
lib/disconnect.c | 18 +--
lib/handle.c | 16 +++
lib/rw.c | 289 ++++++++++++++++++++++++++++++-----------------
tests/errors.c | 61 +++++++++-
6 files changed, 340 insertions(+), 114 deletions(-)
--
2.28.0