From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj4RA-0004wJ-DC for qemu-devel@nongnu.org; Thu, 24 Mar 2016 08:32:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj4R6-00025R-9u for qemu-devel@nongnu.org; Thu, 24 Mar 2016 08:32:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj4R6-00024p-4X for qemu-devel@nongnu.org; Thu, 24 Mar 2016 08:32:24 -0400 References: <1458742562-30624-1-git-send-email-den@openvz.org> <1458742562-30624-3-git-send-email-den@openvz.org> <20160323175834.GC2467@grep.be> <20160324084318.GC24831@phobos.sw.ru> <20160324093315.GA2870@grep.be> <433C735B-1BAE-47DA-9543-2E5BA2710357@alex.org.uk> <56F3D664.9010700@redhat.com> <6045D693-ADB5-4031-852B-CD9FA9BA8156@alex.org.uk> From: Paolo Bonzini Message-ID: <56F3DE52.7060502@redhat.com> Date: Thu, 24 Mar 2016 13:32:18 +0100 MIME-Version: 1.0 In-Reply-To: <6045D693-ADB5-4031-852B-CD9FA9BA8156@alex.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Alex Bligh Cc: "nbd-general@lists.sourceforge.net" , Kevin Wolf , "qemu-devel@nongnu.org" , Pavel Borzenkov , "Stefan stefanha@redhat. com" , "Denis V. Lunev" , Wouter Verhelst On 24/03/2016 13:17, Alex Bligh wrote: >>> >> * unallocated >>> >> * zero >>> >> * non-zero >>> >> >>> >> So the possible replies are a bitfield of those, with a '1' if it 'might' >>> >> be in that state, i.e. >>> >> >>> >> 111 = no idea >>> >> 110 = might be zero or unallocated, but isn't zero >>> >> 011 = I know it's allocated, but I don't know whether it is zero or not >> > >> > How do you represent "definitely unallocated?" > 100 is definitely allocated. The first '1' says it 'might' be in allocated state, > but as we know it's NOT in any of the other states (next two zeroes), by a > process of elimination, it's definitely unallocated. Similarly 010 and 001 > are the two other 'definite' states. An unallocated block can still be definitely zero. Paolo