From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUSK4-0002eL-0v for qemu-devel@nongnu.org; Mon, 22 Apr 2013 21:47:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUSK3-00073C-2l for qemu-devel@nongnu.org; Mon, 22 Apr 2013 21:47:07 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:46607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUSK2-000738-Qn for qemu-devel@nongnu.org; Mon, 22 Apr 2013 21:47:06 -0400 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 22 Apr 2013 19:47:06 -0600 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id B5BA819D8043 for ; Mon, 22 Apr 2013 19:46:58 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3N1l3x8130860 for ; Mon, 22 Apr 2013 19:47:03 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3N1ns4x023101 for ; Mon, 22 Apr 2013 19:49:55 -0600 Message-ID: <5175E818.9040107@linux.vnet.ibm.com> Date: Tue, 23 Apr 2013 09:47:04 +0800 From: Dong Xu Wang MIME-Version: 1.0 References: <1365581513-3475-1-git-send-email-wdongxu@linux.vnet.ibm.com> <1365581513-3475-5-git-send-email-wdongxu@linux.vnet.ibm.com> <20130418085412.GB19587@stefanha-thinkpad.redhat.com> In-Reply-To: <20130418085412.GB19587@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V18 4/6] rename qcow2-cache.c to block-cache.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwol@redhat.com, wdongxu@cn.ibm.com, qemu-devel@nongnu.org, stefanha@redhat.com On 2013/4/18 16:54, Stefan Hajnoczi wrote: > On Wed, Apr 10, 2013 at 04:11:51PM +0800, Dong Xu Wang wrote: > > This patch does two things: > 1. Rename and move qcow2-cache to block-cache. > 2. Add a type enum to parameterize BLKDEBUG_EVENT() for L2, refcount, > and bitmaps. > > It's hard to review #2 since all lines are changed in the diff by #1. > In the future, please split patches that move code into two. > > The first patch should simply move and rename - it should not include > code changes. > > The second patch should contain code changes (i.e. adding the cache type > enum and parameterizing BLKDEBUG_EVENT()). > > BTW, when splitting the patch into two for easy reviewing it also > becomes questionable whether to reassign authorship since 90+% of the > code is unchanged and simply moved. > Okay. >> + if (c->table_type == BLOCK_TABLE_REF) { >> + 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); > > BLKDBG_COW_WRITE is for writing out sectors from the backing file. It > is not for updating the allocation bitmap. > Okay. > Please pick an appropriate constant or define your own if none exists. > >> + 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); > > Same here. > >