From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anBsd-000541-L9 for qemu-devel@nongnu.org; Mon, 04 Apr 2016 17:17:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anBsa-0005Fy-EU for qemu-devel@nongnu.org; Mon, 04 Apr 2016 17:17:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anBsa-0005Fh-6D for qemu-devel@nongnu.org; Mon, 04 Apr 2016 17:17:48 -0400 References: <1459787950-15286-1-git-send-email-eblake@redhat.com> <7AD0DCB1-1868-4AAD-A03D-C976A728DD75@alex.org.uk> <5702C1AB.8020601@redhat.com> <5702C8C3.1050300@openvz.org> <5702CAEA.4060804@openvz.org> <5702CE48.40302@openvz.org> <5702D279.6080905@redhat.com> <5702D6E2.1090901@openvz.org> From: Eric Blake Message-ID: <5702D9FA.20207@redhat.com> Date: Mon, 4 Apr 2016 15:17:46 -0600 MIME-Version: 1.0 In-Reply-To: <5702D6E2.1090901@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tmfhVIqsLc3vBKlcaghu5bhvivNOvUm1c" Subject: Re: [Qemu-devel] [Nbd] [PATCH v2] doc: Add NBD_CMD_BLOCK_STATUS extension List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" , Alex Bligh Cc: "nbd-general@lists.sourceforge.net" , Kevin Wolf , "qemu-devel@nongnu.org" , Pavel Borzenkov , "Stefan stefanha@redhat. com" , Wouter Verhelst , Paolo Bonzini This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tmfhVIqsLc3vBKlcaghu5bhvivNOvUm1c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/04/2016 03:04 PM, Denis V. Lunev wrote: > In v1 we have had 'status' field, which can have the > following values for dirty request: >=20 > + - `NBD_STATE_DIRTY` (0x0), LBA extent is dirty; > + - `NBD_STATE_CLEAN` (0x1), LBA extent is clean. >=20 > in the extent structure: >=20 > + * 64 bits, offset (unsigned) > + * 32 bits, length (unsigned) > + * 16 bits, status (unsigned) Between v1 and v2, we dropped 64-bit offset (offset is now implied, by adding lengths of all earlier descriptors), and widened status from 16 bits to 32 bits (so that each descriptor is now naturally 8-byte aligned and therefore easier to make a C array). >=20 > with an additional NBD_STATE_DIRTY_HOLE or (DIRTY_DEALLOCATED) > we could report the entire state using one query. The user could be > able to read entire state which is useful for backup at once. >=20 > Your current proposal is more tricky and it was misunderstood by Alex: >=20 > + * 32 bits, status flags >=20 > and you describe flags as >=20 > + - `NBD_STATE_HOLE` (bit 0); if set, the block represents a hole > + - `NBD_STATE_ZERO` (bit 1), if set, the block contents read as >=20 > + - `NBD_STATE_CLEAN` (bit 2); if set, the block represents a > and opinion of Alex was that all 3 bits could be set in reply to > NBD_CMD_BLOCK_STATUS > with NBD_CMD_FLAG_STATUS_DIRTY set. >=20 > This confused him. This confuses me too. There's nothing that says that NBD_STATE_CLEAN can't be reassigned to bit 0. Conversely, we may want to add a future NBD_CMD_FLAG_FOO that lets you read allocation and dirty information in the same call, in which case having the bits be distinct will make that easier; but where we would also make it obvious that the server is allowed to reject that command flag as unsupported (we already state the server can reject NBD_CMD_FLAG_STATUS_DIRTY with EINVAL as unsupported; and that it if does not reject a dirtiness request but cannot otherwise report anything, then the entire region is reported as dirty). I don't have any strong opinions on whether NBD_STATE_CLEAN should remain bit 2 or be renumbered to bit 0, although renumbering it to bit 0 would make it painfully obvious that you cannot query allocation and dirtiness at the same time. >=20 > If allocated state is not replied to command with NBD_CMD_FLAG_STATUS_D= IRTY > then why to have different meaning of bits. Because we still have room - no need to overlap the meaning of bits as long as we have more bits to choose from. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --tmfhVIqsLc3vBKlcaghu5bhvivNOvUm1c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXAtn6AAoJEKeha0olJ0NqdRAH/i3dp+6ejjikbHsl4yZq4I38 EEj9Nm5LejQxgTw5odTd9qtfqKdN6cacfTFJad0W5YdPIdQpvnQ8l1fIIBY9F8kk 8SPjWZUyk1aD/0hYeWOlecRdYqOh348G0GbOlaKL7dw+8xKqlVGDAkjEDk9E740O xZ7hTuCt7O7GHf4xWbXeAJV7H8i/gzKzL7phPf5ay042rTMyO5DkFdv/WKBdh4sM 7orsuajgRFgrnquLbBBQFRIiGnNuRE8aSDfSGad8cmnqvGp1X8hdNVAMpg/GulGa 279zoQ2gwuiwAjmgpKDmR52PdrbvMSueHL5UIYfRHfcwDiyszHUD6M8sBzQPMsY= =5jP1 -----END PGP SIGNATURE----- --tmfhVIqsLc3vBKlcaghu5bhvivNOvUm1c--