From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj7Gl-0002DB-4t for qemu-devel@nongnu.org; Thu, 24 Mar 2016 11:33:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj7Gg-0007Z5-Rd for qemu-devel@nongnu.org; Thu, 24 Mar 2016 11:33:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj7Gg-0007Xu-KU for qemu-devel@nongnu.org; Thu, 24 Mar 2016 11:33:50 -0400 References: <1458742562-30624-1-git-send-email-den@openvz.org> <1458742562-30624-3-git-send-email-den@openvz.org> <20160323175834.GC2467@grep.be> <56F3D5C7.9070007@redhat.com> <56F406E7.4010207@redhat.com> From: Paolo Bonzini Message-ID: <56F408D6.2020002@redhat.com> Date: Thu, 24 Mar 2016 16:33:42 +0100 MIME-Version: 1.0 In-Reply-To: <56F406E7.4010207@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6SnrGwd2HTCwIjj3qIp5llJ1wo8lNiFsC" Subject: Re: [Qemu-devel] [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Wouter Verhelst , "Denis V. Lunev" Cc: nbd-general@lists.sourceforge.net, Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6SnrGwd2HTCwIjj3qIp5llJ1wo8lNiFsC Content-Type: multipart/mixed; boundary="OSvfvnuFXcUIxXIcR5jcMKILSFptuUCQA" From: Paolo Bonzini To: Eric Blake , Wouter Verhelst , "Denis V. Lunev" Cc: nbd-general@lists.sourceforge.net, Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi Message-ID: <56F408D6.2020002@redhat.com> Subject: Re: [Qemu-devel] [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension References: <1458742562-30624-1-git-send-email-den@openvz.org> <1458742562-30624-3-git-send-email-den@openvz.org> <20160323175834.GC2467@grep.be> <56F3D5C7.9070007@redhat.com> <56F406E7.4010207@redhat.com> In-Reply-To: <56F406E7.4010207@redhat.com> --OSvfvnuFXcUIxXIcR5jcMKILSFptuUCQA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 24/03/2016 16:25, Eric Blake wrote: >> However, let's make these bits, so that >> >> NBD_STATE_ALLOCATED (0x1), LBA extent is present on the block device >> NBD_STATE_ZERO (0x2), LBA extent will read as zeroes >=20 > Should we flip the sense and call this NBD_STATE_UNALLOCATED (0 means > allocated, 1 means not present), so that an overall status of 0 is a > safe default? Double negations are evil (and don't work the same in all languages), so I think it's a worse option. >> An implementation that doesn't track the "dirtiness" state of bloc= ks >> MUST either fail this command with EINVAL, or mark all blocks as >> dirty in the descriptor that it returns. >=20 > Is it feasible to return zero/allocated/dirty status all at the same > time, or do we want to strictly require two different modes of > operation? I think we should differentiate them, because it makes sense to support only one. In particular, while it is more or less obvious that (in my proposal above) a trivial implementation must return NBD_STATE_ALLOCATED, it is quite weird to require a trivial implementation to return NBD_STATE_ALLOCATED|NBD_STATE_DIRTY. Paolo > That is, if we are returning zero and allocated as two bits, > can we also return a third bit for dirty/clean? Should we flip the > sense of the bit, where 0 means dirty and 1 means clean, again so that = a > server can always return a status of 0 as the safe default? >=20 --OSvfvnuFXcUIxXIcR5jcMKILSFptuUCQA-- --6SnrGwd2HTCwIjj3qIp5llJ1wo8lNiFsC 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 iQEcBAEBCAAGBQJW9AjWAAoJEL/70l94x66Dh8gH/jaKXYSD5hRql5PWiwdDqGnA 8PLWG4bhD6dh79hgJnpn30NIeB14OtNlK1GE6A3DNHOyjSJgCH38TrvIdujWRUdk QRPyv2KuomTwsOtN9ajU+THrhaj9m3Y73LkKL5x26UX3xmqo5i2gIPVDw+hAOeFL 1IteBSGiz+gpDoJ51p5Jc109krGmTslnaQOJPkXVFKCJKR1rW/CXlLNgLTgTwPQG 4FAuU2zw5s6bu0sHBBhYiBONjCniKSmTM55ttG6K5R9bwWFujbpCiYRIL7lufrfj DMCND1woCnK5m/Csju69bOLkFH7P77LB6jueUaYL3GhwJSvlkwkMDBieogToE40= =DnnS -----END PGP SIGNATURE----- --6SnrGwd2HTCwIjj3qIp5llJ1wo8lNiFsC--