From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiLmL-0001XT-NW for qemu-devel@nongnu.org; Tue, 11 Dec 2012 04:05:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiLmK-0000kh-Ed for qemu-devel@nongnu.org; Tue, 11 Dec 2012 04:05:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:23711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiLmK-0000kV-66 for qemu-devel@nongnu.org; Tue, 11 Dec 2012 04:05:28 -0500 Message-ID: <50C6F6F9.5060302@redhat.com> Date: Tue, 11 Dec 2012 10:03:53 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1354776711-12449-1-git-send-email-wdongxu@linux.vnet.ibm.com> <1354776711-12449-6-git-send-email-wdongxu@linux.vnet.ibm.com> <50C621EC.3010709@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V17 5/6] add-cow file format core code. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dong Xu Wang Cc: qemu-devel Am 11.12.2012 09:11, schrieb Dong Xu Wang: >>> index bf5c57c..1a30462 100644 >>> --- a/block/block-cache.c >>> +++ b/block/block-cache.c >>> @@ -112,6 +112,8 @@ static int block_cache_entry_flush(BlockDriverState *bs, BlockCache *c, int i) >>> BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_UPDATE_PART); >>> } else if (c->table_type == BLOCK_TABLE_L2) { >>> BLKDBG_EVENT(bs->file, BLKDBG_L2_UPDATE); >>> + } else if (c->table_type == BLOCK_TABLE_BITMAP) { >>> + BLKDBG_EVENT(bs->file, BLKDBG_COW_WRITE); >>> } >>> >>> ret = bdrv_pwrite(bs->file, c->entries[i].offset, >>> @@ -245,6 +247,8 @@ static int block_cache_do_get(BlockDriverState *bs, BlockCache *c, >>> if (read_from_disk) { >>> if (c->table_type == BLOCK_TABLE_L2) { >>> BLKDBG_EVENT(bs->file, BLKDBG_L2_LOAD); >>> + } else if (c->table_type == BLOCK_TABLE_BITMAP) { >>> + BLKDBG_EVENT(bs->file, BLKDBG_COW_READ); >>> } >> >> I must admit that I don't like this table_type stuff at all, even more >> so if every new format adds new types to it. Not sure what to suggest here. >> >> But anyway, even if we leave it, aren't BLKDBG_COW_READ/WRITE something >> completely different? > > Sorry, I have read enum BlkDebugEvent to find out which type would be > suitable for this case. In the previous > comments, you said existing DebugEvent types would be enough, do you > think which types should be picked up > for add-cow BLKDBG_EVENT? Maybe BLKDBG_L2_LOAD/UPDATE? Kevin