On Wed, Feb 21, 2024 at 03:05:50PM -0600, Eric Blake wrote:
On Wed, Feb 21, 2024 at 07:12:28PM +0000, Richard W.M. Jones wrote:
+++ b/docs/nbdkit-protocol.pod
+as sparse reads or meta contexts for obtaining block status. By +default, nbdkit advertises as many features as it can support (in some +cases, this can be limited by what callbacks the plugin handles), even +if the client does not negotiate to use all advertised features.
Nbdkit also includes some options that are useful mainly when performing integration tests, for proving whether clients have sane fallback behavior when dealing various older servers permitted by the -NBD protocol. Use the I<--no-sr> flag to force the newstyle protocol -to decline any client request for structured replies. Use the -I<--mask-handshake> parameter to mask off particular global features -which are advertised during new-style handshake (defaulting to all -supported bits set). Clearing bit 0 (the low order bit) limits a -client to using just C<NBD_OPT_EXPORT_NAME> (and is incompatible with -TLS or structured replies); clearing bit 1 causes the handshake to -send more padding bytes in response to C<NBD_OPT_EXPORT_NAME>. Other -bits in the mask will only have an effect if the NBD protocol is +NBD protocol. The following options intentionally disable optional +parts of the NBD protocol, with successively larger impacts: + +Use the I<--no-meta-contexts> flag to force the newstyle protocol to
If you wanted you could do this:
NBD protocol. The following options intentionally disable optional parts of the NBD protocol, with successively larger impacts:
=over 4
=item I<--no-meta-contexts>
Force the newstyle protocol to [...]
=item I<--no-sr>
[...]
=item I<--mask-handshake>
[...]
=back
Yeah, that does look nicer. I amended along those lines,...
Looks alright, so:
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
...then pushed the result as commit 3e401181
Would it also be worth a quick followup to add a --no-structured-replies alias for --no-sr, and/or to document the --no-mc alias silently added here?
Whichever you want.
Down the road, it would be nice to teach nbdkit to do extended headers (since qemu and libnbd already support it); at that time, it would also make sense to add --no-eh / --no-extended-headers options with comparable semantics.
Yup. However it requires a new plugin ABI version I think, since all the count parameters will change from uint32_t to uint64_t. I can't remember if you had patches already for this or not? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v