From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgbbs-0008Fw-Qt for qemu-devel@nongnu.org; Wed, 13 Nov 2013 09:40:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vgbbl-0000Ew-IX for qemu-devel@nongnu.org; Wed, 13 Nov 2013 09:40:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgbbl-0000ES-9p for qemu-devel@nongnu.org; Wed, 13 Nov 2013 09:39:53 -0500 Message-ID: <52838F2F.5010404@redhat.com> Date: Wed, 13 Nov 2013 15:39:43 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1384271389-20716-1-git-send-email-pbonzini@redhat.com> <1384271389-20716-10-git-send-email-pbonzini@redhat.com> <93FBFFE9-D6A4-4540-AEFB-1D4CE250E61F@kamp.de> <528349F7.1060700@redhat.com> <9DB54347-EE54-4B1C-B87E-586D2FE9014A@kamp.de> In-Reply-To: <9DB54347-EE54-4B1C-B87E-586D2FE9014A@kamp.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/11] raw-posix: implement write_zeroes with MAY_UNMAP for block devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Il 13/11/2013 15:14, Peter Lieven ha scritto: >>> >> does BLKDISCARDZEROES ioctl guarantee that a device is >>> >> zero initialized or does it just guarantee that a discard may not >>> >> fail and that it reads as zeroes afterwards? >> > >> > Only the latter. ".bdrv_has_zero_init" is only present in the bdrv_file >> > BlockDriver. > Then bdi->unallocated_blocks_are_zero must stay 0. .bdrv_has_zero_init's > semantic is to reflect the zero status of all blocks of the device right after bdrv_create > independently of their allocation status. bdi->unallocated_blocks_are_zero > reflects the zero status of every unallocated block regardless if it was > unallocated right from the beginning or became unallocated through a discard. What we have is: * bdi->unallocated_blocks_are_zero returns true * bdrv_create doesn't ensure that every block starts unallocated * hence bdrv_has_zero_init returns false Blocks that (for any reason) are unallocated after bdrv_create *will* be zero if BLKDISCARDZEROES returns true. Paolo