From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdHUF-0004zU-8a for qemu-devel@nongnu.org; Mon, 04 Nov 2013 05:34:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdHU9-0006Au-8k for qemu-devel@nongnu.org; Mon, 04 Nov 2013 05:34:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdHU9-0006Ap-0V for qemu-devel@nongnu.org; Mon, 04 Nov 2013 05:34:17 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA4AYFSJ001772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 4 Nov 2013 05:34:15 -0500 Message-ID: <52777827.7040108@redhat.com> Date: Mon, 04 Nov 2013 11:34:15 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1383116892-11047-1-git-send-email-famz@redhat.com> <1383116892-11047-4-git-send-email-famz@redhat.com> <5270BA10.2090904@redhat.com> <527745D2.7020606@redhat.com> In-Reply-To: <527745D2.7020606@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] block: per caller dirty bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Il 04/11/2013 07:59, Fam Zheng ha scritto: >>> >> I think callers outside block.c should only call >> hbitmap_set/hbitmap_reset; resetting is typically done before processing >> sectors and setting after an error (both of which happen privately to >> each task). >> >> Thus you probably should add a fourth patch which makes >> bdrv_(re)set_dirty static and remove >> bdrv_get_dirty/bdrv_dirty_iter_init/bdrv_get_dirty_count. > I like the idea of adding a wrapper struct (will be BdrvDirtyBitmap) to > HBitmap so that patch 1 is not needed, and HBitmap becomes (almost) > internal to block.c. > > But I'm not sure removing > bdrv_get_dirty/bdrv_dirty_iter_init/bdrv_get_dirty_count is good, as we > are exposing BdrvDirtyBitmap, we should also provide operations on it, > instead of let callers to handle HBitmap pointer inside. In other words, > I prefer to define BdrvDirtyBitmap structure in block.c and only put a > type declaration in header. If you want to expose BdrvDirtyBitmap, having wrappers is fine. I was thinking of exposing HBitmap instead and keeping BdrvDirtyBitmap internal. Either way is fine, and as the person who writes the code you have the privilege of making the choice. :) Paolo