From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDRt3-0005oy-QL for qemu-devel@nongnu.org; Thu, 16 Jun 2016 03:38:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDRsy-00049t-6H for qemu-devel@nongnu.org; Thu, 16 Jun 2016 03:38:48 -0400 Date: Thu, 16 Jun 2016 15:38:35 +0800 From: Fam Zheng Message-ID: <20160616073835.GC15312@ad.usersys.redhat.com> References: <1466060287-31514-1-git-send-email-den@openvz.org> <1466060287-31514-4-git-send-email-den@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466060287-31514-4-git-send-email-den@openvz.org> Subject: Re: [Qemu-devel] [PATCH 3/3] block: process before_write_notifiers in bdrv_co_discard List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , Kevin Wolf , Max Reitz On Thu, 06/16 09:58, Denis V. Lunev wrote: > This is mandatory for correct backup creation. In the other case the > content under this area would be lost. > > Dirty bits are set exactly like in bdrv_aligned_pwritev, i.e. they are set > even if notifier has returned a error. > > Signed-off-by: Denis V. Lunev > CC: Vladimir Sementsov-Ogievskiy > CC: Stefan Hajnoczi > CC: Fam Zheng > CC: Kevin Wolf > CC: Max Reitz > --- > block/io.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/block/io.c b/block/io.c > index 513bd99..92d9fe3 100644 > --- a/block/io.c > +++ b/block/io.c > @@ -2266,6 +2266,11 @@ int coroutine_fn bdrv_co_discard(BlockDriverState *bs, int64_t sector_num, > tracked_request_begin(&req, bs, NULL, sector_num << BDRV_SECTOR_BITS, > nb_sectors << BDRV_SECTOR_BITS, BDRV_TRACKED_DISCARD); > > + ret = notifier_with_return_list_notify(&bs->before_write_notifiers, &req); > + if (ret < 0) { > + goto out; > + } > + > max_discard = MIN_NON_ZERO(bs->bl.max_discard, BDRV_REQUEST_MAX_SECTORS); > while (nb_sectors > 0) { > int ret; > -- > 2.5.0 > Reviewed-by: Fam Zheng