From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXoBQ-0001Tc-89 for qemu-devel@nongnu.org; Thu, 11 Aug 2016 07:29:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXoBO-0007Ta-Qf for qemu-devel@nongnu.org; Thu, 11 Aug 2016 07:29:55 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:11375 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXoBO-0007TM-EO for qemu-devel@nongnu.org; Thu, 11 Aug 2016 07:29:54 -0400 References: <1470668720-211300-1-git-send-email-vsementsov@virtuozzo.com> <1470668720-211300-17-git-send-email-vsementsov@virtuozzo.com> <20160811112446.GC5035@noname.redhat.com> From: Vladimir Sementsov-Ogievskiy Message-ID: <57AC61A2.3020508@virtuozzo.com> Date: Thu, 11 Aug 2016 14:29:38 +0300 MIME-Version: 1.0 In-Reply-To: <20160811112446.GC5035@noname.redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 16/29] block: add bdrv_load_dirty_bitmap() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com, armbru@redhat.com, eblake@redhat.com, jsnow@redhat.com, famz@redhat.com, den@openvz.org, stefanha@redhat.com, pbonzini@redhat.com On 11.08.2016 14:24, Kevin Wolf wrote: > Am 08.08.2016 um 17:05 hat Vladimir Sementsov-Ogievskiy geschrieben: >> The funcion loads dirty bitmap from file, using underlying driver >> function. >> >> Signed-off-by: Vladimir Sementsov-Ogievskiy >> --- >> block/dirty-bitmap.c | 16 ++++++++++++++++ >> include/block/dirty-bitmap.h | 2 ++ >> 2 files changed, 18 insertions(+) >> >> diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c >> index 6df7fe1..1d0ea25 100644 >> --- a/block/dirty-bitmap.c >> +++ b/block/dirty-bitmap.c >> @@ -597,3 +597,19 @@ void bdrv_finalize_persistent_dirty_bitmaps(BlockDriverState *bs) >> } >> } >> } >> + >> +BdrvDirtyBitmap *bdrv_load_dirty_bitmap(BlockDriverState *bs, const char *name, >> + Error **errp) >> +{ >> + BlockDriver *drv = bs->drv; >> + if (!drv) { >> + return NULL; >> + } >> + if (drv->bdrv_dirty_bitmap_load) { >> + return drv->bdrv_dirty_bitmap_load(bs, name, errp); > Why the inconsistency between load_dirty and dirty_load? The bdrv_* > wrappers usually have exactly the same name as the BlockDriver fields. > >> + } >> + if (bs->file) { >> + return bdrv_load_dirty_bitmap(bs, name, errp); >> + } >> + return NULL; >> +} > Let me ask a general question about this series: What is the expected > state after it is applied? > > I'm asking because even after the full series is applied, I don't see a > single user of bdrv_load_dirty_bitmap(), bdrv_load_check_dirty_bitmap() > or bdrv_store_dirty_bitmap(). Is all of this dead code? Hmm, you are right, it's my mistake. It is dead code after removing command line options for dirty bitmaps from the series. Also, for now only autoloading bitmaps can be loaded. I'll remove these functions in next version, they may be added later, when we need loading bitmaps by request (qmp command or cmd line). > > Kevin -- Best regards, Vladimir