04.12.2021 02:14, Eric Blake wrote:
Add a new negotiation feature where the client and server agree to
use
larger packet headers on every packet sent during transmission phase.
This has two purposes: first, it makes it possible to perform
operations like trim, write zeroes, and block status on more than 2^32
bytes in a single command; this in turn requires that some structured
replies from the server also be extended to match. The wording chosen
here is careful to permit a server to use either flavor in its reply
(that is, a request less than 32-bits can trigger an extended reply,
and conversely a request larger than 32-bits can trigger a compact
reply).
About this.. Isn't it too permissive?
I think that actually having to very similar ways to do the same thing is usually a bad
design. I think we don't want someone implement the logic, which tries to send 32bit
commands/replies for small requests and 64bit command/replies for larger ones? Moreover,
you don't allow doing it for commands. So, for symmetry, it may be good to be strict
with replies too: in 64bit mode only 64bit replies.
Now we of course have to support old 32bit commands and new 64bit commands. But, may be,
we'll want to deprecate 32bit commands at some moment? I'm not sure we can
deprecate them in protocol, but we can deprecate them in Qemu at least. And several years
later we'll drop old code, keeping only support for 64bit commands. Less code paths,
less similar structures, simpler code, I think it worth it.
--
Best regards,
Vladimir