From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhJ2T-0008GT-AP for qemu-devel@nongnu.org; Wed, 30 Sep 2015 11:11:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhJ2O-0004Ue-8F for qemu-devel@nongnu.org; Wed, 30 Sep 2015 11:11:25 -0400 Date: Wed, 30 Sep 2015 11:11:06 -0400 From: Jeff Cody Message-ID: <20150930151106.GC11943@localhost.localdomain> References: <20150928152316.GB19184@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150928152316.GB19184@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 3/3] block: mirror - zero unallocated target sectors when zero init not present List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, stefanha@redhat.com On Mon, Sep 28, 2015 at 04:23:16PM +0100, Stefan Hajnoczi wrote: > On Sun, Sep 27, 2015 at 11:29:18PM -0400, Jeff Cody wrote: > > + if (s->zero_cycle) { > > + ret = bdrv_get_block_status(s->target, sector_num, nb_sectors, &pnum); > > + if (!(ret & BDRV_BLOCK_ZERO)) { > > + bdrv_aio_write_zeroes(s->target, sector_num, op->nb_sectors, > > + s->unmap ? BDRV_REQ_MAY_UNMAP : 0, > > + mirror_write_complete, op); > > mirror_write_complete will advance s->common.offset. Won't the progress > be incorrect if we do that for both zeroing and regular mirroring? Good point. However, Is it really wrong to count it in the progress, if we do the zero mirror pass? I