From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USkbj-0007tf-5U for qemu-devel@nongnu.org; Thu, 18 Apr 2013 04:54:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USkbh-0004m4-R3 for qemu-devel@nongnu.org; Thu, 18 Apr 2013 04:54:19 -0400 Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]:35129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USkbh-0004lt-KT for qemu-devel@nongnu.org; Thu, 18 Apr 2013 04:54:17 -0400 Received: by mail-we0-f178.google.com with SMTP id z53so1970836wey.23 for ; Thu, 18 Apr 2013 01:54:16 -0700 (PDT) Date: Thu, 18 Apr 2013 10:54:12 +0200 From: Stefan Hajnoczi Message-ID: <20130418085412.GB19587@stefanha-thinkpad.redhat.com> References: <1365581513-3475-1-git-send-email-wdongxu@linux.vnet.ibm.com> <1365581513-3475-5-git-send-email-wdongxu@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1365581513-3475-5-git-send-email-wdongxu@linux.vnet.ibm.com> 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: Dong Xu Wang Cc: kwol@redhat.com, wdongxu@cn.ibm.com, qemu-devel@nongnu.org, stefanha@redhat.com 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. > + 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. 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.