From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8ms4-0005wS-M8 for qemu-devel@nongnu.org; Mon, 21 Nov 2016 06:34:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8ms4-0004vh-0u for qemu-devel@nongnu.org; Mon, 21 Nov 2016 06:34:48 -0500 Date: Mon, 21 Nov 2016 12:34:36 +0100 From: Kevin Wolf Message-ID: <20161121113436.GA5876@noname.redhat.com> References: <20161121012439.2394-1-w90p710@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161121012439.2394-1-w90p710@gmail.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block/mirror: enable detect zeroes when driving mirror List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yang Wei Cc: jcody@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Am 21.11.2016 um 02:24 hat Yang Wei geschrieben: > In order to preserve sparse disk image, detect_zeroes > should also be enabled when bdrv_get_block_status_above() > returns BDRV_BLOCK_DATA > > Signed-off-by: Yang Wei Just preserving sparseness is exactly why bdrv_get_block_status_above() is checked, and this happens always. detect_zeroes does not preserve sparseness, but detect zeroes in parts of the source image that are not sparse, and make them sparse in the target image. This means that it has higher overhead (because all sectors need to be processed before copying them) and doesn't result in an exact copy. There may be cases where this is wanted, but in the common case, it's probably not the right mode of operation. If you really want to detect zeroes, create the target block driver node manually (with detect-zeroes=on) and use the blockdev-mirror QMP command to mirror to it. Kevin