From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXo6c-0005ux-QN for qemu-devel@nongnu.org; Thu, 11 Aug 2016 07:24:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXo6a-0006P6-Rn for qemu-devel@nongnu.org; Thu, 11 Aug 2016 07:24:57 -0400 Date: Thu, 11 Aug 2016 13:24:46 +0200 From: Kevin Wolf Message-ID: <20160811112446.GC5035@noname.redhat.com> References: <1470668720-211300-1-git-send-email-vsementsov@virtuozzo.com> <1470668720-211300-17-git-send-email-vsementsov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1470668720-211300-17-git-send-email-vsementsov@virtuozzo.com> 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: Vladimir Sementsov-Ogievskiy 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 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? Kevin