Received: from eggs.gnu.org ([2001:4830:134:3::10]:59365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUwD8-0008MZ-HY for qemu-devel@nongnu.org; Mon, 18 Jun 2018 11:36:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUwD5-0000Me-Ea for qemu-devel@nongnu.org; Mon, 18 Jun 2018 11:36:54 -0400 From: Alberto Garcia In-Reply-To: <1528461148-17925-11-git-send-email-ari@tuxera.com> References: <1528461148-17925-1-git-send-email-ari@tuxera.com> <1528461148-17925-11-git-send-email-ari@tuxera.com> Date: Mon, 18 Jun 2018 17:36:44 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v4 10/10] block/blklogwrites: Use the block device logical sector size when logging writes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ari Sundholm , qemu-devel@nongnu.org Cc: Kevin Wolf , "open list:blklogwrites" , Max Reitz On Fri 08 Jun 2018 02:32:28 PM CEST, Ari Sundholm wrote: > The guest OS may perform writes which are aligned to the logical > sector size instead of the physical one, so logging at this granularity > records the writes performed on the block device most faithfully. > > Signed-off-by: Ari Sundholm > --- > block/blklogwrites.c | 47 ++++++++++++++++++++++++++++++++--------------- > 1 file changed, 32 insertions(+), 15 deletions(-) > > diff --git a/block/blklogwrites.c b/block/blklogwrites.c > index 216367f..decf5e5 100644 > --- a/block/blklogwrites.c > +++ b/block/blklogwrites.c > @@ -47,6 +47,8 @@ struct log_write_entry { > > typedef struct { > BdrvChild *log_file; > + uint32_t sectorsize; > + uint32_t sectorbits; > uint64_t cur_log_sector; > uint64_t nr_entries; > } BDRVBlkLogWritesState; > @@ -67,6 +69,8 @@ static int blk_log_writes_open(BlockDriverState *bs, QDict *options, int flags, > goto fail; > } > > + s->sectorsize = BDRV_SECTOR_SIZE; /* May be updated later */ > + s->sectorbits = BDRV_SECTOR_BITS; > s->cur_log_sector = 1; > s->nr_entries = 0; I haven't looked closely into this series so sorry if there's something that I'm overlooking, but this caught my attention: why do you have a patch that improves a driver that you introduced earlier in this same series? Berto