[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] spec: Add NBD_OPT_EXTENDED_HEADERS
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [PATCH] spec: Add NBD_OPT_EXTENDED_HEADERS |
Date: |
Fri, 10 Dec 2021 21:16:12 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
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
[PATCH 00/14] qemu patches for NBD_OPT_EXTENDED_HEADERS, Eric Blake, 2021/12/03
- [PATCH 01/14] nbd/server: Minor cleanups, Eric Blake, 2021/12/03
- [PATCH 02/14] qemu-io: Utilize 64-bit status during map, Eric Blake, 2021/12/03
- [PATCH 06/14] nbd: Prepare for 64-bit requests, Eric Blake, 2021/12/03
- [PATCH 05/14] nbd/server: Prepare for alternate-size headers, Eric Blake, 2021/12/03
- [PATCH 03/14] qemu-io: Allow larger write zeroes under no fallback, Eric Blake, 2021/12/03
- [PATCH 04/14] nbd/client: Add safety check on chunk payload length, Eric Blake, 2021/12/03