Message ID | 1453270306-16608-10-git-send-email-famz@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 20.01.2016 09:11, Fam Zheng wrote: > For dirty bitmap users to get the size and the name of a > BdrvDirtyBitmap. > > Signed-off-by: Fam Zheng <famz@redhat.com> > Reviewed-by: John Snow <jsnow@redhat.com> > --- > block/dirty-bitmap.c | 10 ++++++++++ > include/block/dirty-bitmap.h | 2 ++ > 2 files changed, 12 insertions(+) > > diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c > index d75dcf7..de143f1 100644 > --- a/block/dirty-bitmap.c > +++ b/block/dirty-bitmap.c > @@ -153,6 +153,16 @@ void bdrv_dirty_bitmap_reset_meta(BlockDriverState *bs, > hbitmap_reset(bitmap->meta, sector, nb_sectors); > } > > +int64_t bdrv_dirty_bitmap_size(BdrvDirtyBitmap *bitmap) > +{ > + return bitmap->size; > +} > + > +const char *bdrv_dirty_bitmap_name(BdrvDirtyBitmap *bitmap) > +{ > + return bitmap->name; > +} Please, s/BdrvDirtyBitmap */const BdrvDirtyBitmap */ > + > bool bdrv_dirty_bitmap_frozen(BdrvDirtyBitmap *bitmap) > { > return bitmap->successor; > diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h > index d9b281a..8c29c3e 100644 > --- a/include/block/dirty-bitmap.h > +++ b/include/block/dirty-bitmap.h > @@ -32,6 +32,8 @@ uint32_t bdrv_get_default_bitmap_granularity(BlockDriverState *bs); > uint32_t bdrv_dirty_bitmap_granularity(BdrvDirtyBitmap *bitmap); > bool bdrv_dirty_bitmap_enabled(BdrvDirtyBitmap *bitmap); > bool bdrv_dirty_bitmap_frozen(BdrvDirtyBitmap *bitmap); > +const char *bdrv_dirty_bitmap_name(BdrvDirtyBitmap *bitmap); > +int64_t bdrv_dirty_bitmap_size(BdrvDirtyBitmap *bitmap); > DirtyBitmapStatus bdrv_dirty_bitmap_status(BdrvDirtyBitmap *bitmap); > int bdrv_get_dirty(BlockDriverState *bs, BdrvDirtyBitmap *bitmap, int64_t sector); > void bdrv_set_dirty_bitmap(BdrvDirtyBitmap *bitmap,
On Fri, 01/22 14:45, Vladimir Sementsov-Ogievskiy wrote: > On 20.01.2016 09:11, Fam Zheng wrote: > >For dirty bitmap users to get the size and the name of a > >BdrvDirtyBitmap. > > > >Signed-off-by: Fam Zheng <famz@redhat.com> > >Reviewed-by: John Snow <jsnow@redhat.com> > >--- > > block/dirty-bitmap.c | 10 ++++++++++ > > include/block/dirty-bitmap.h | 2 ++ > > 2 files changed, 12 insertions(+) > > > >diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c > >index d75dcf7..de143f1 100644 > >--- a/block/dirty-bitmap.c > >+++ b/block/dirty-bitmap.c > >@@ -153,6 +153,16 @@ void bdrv_dirty_bitmap_reset_meta(BlockDriverState *bs, > > hbitmap_reset(bitmap->meta, sector, nb_sectors); > > } > >+int64_t bdrv_dirty_bitmap_size(BdrvDirtyBitmap *bitmap) > >+{ > >+ return bitmap->size; > >+} > >+ > >+const char *bdrv_dirty_bitmap_name(BdrvDirtyBitmap *bitmap) > >+{ > >+ return bitmap->name; > >+} > > Please, s/BdrvDirtyBitmap */const BdrvDirtyBitmap */ Okay, will add. Fam > > >+ > > bool bdrv_dirty_bitmap_frozen(BdrvDirtyBitmap *bitmap) > > { > > return bitmap->successor; > >diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h > >index d9b281a..8c29c3e 100644 > >--- a/include/block/dirty-bitmap.h > >+++ b/include/block/dirty-bitmap.h > >@@ -32,6 +32,8 @@ uint32_t bdrv_get_default_bitmap_granularity(BlockDriverState *bs); > > uint32_t bdrv_dirty_bitmap_granularity(BdrvDirtyBitmap *bitmap); > > bool bdrv_dirty_bitmap_enabled(BdrvDirtyBitmap *bitmap); > > bool bdrv_dirty_bitmap_frozen(BdrvDirtyBitmap *bitmap); > >+const char *bdrv_dirty_bitmap_name(BdrvDirtyBitmap *bitmap); > >+int64_t bdrv_dirty_bitmap_size(BdrvDirtyBitmap *bitmap); > > DirtyBitmapStatus bdrv_dirty_bitmap_status(BdrvDirtyBitmap *bitmap); > > int bdrv_get_dirty(BlockDriverState *bs, BdrvDirtyBitmap *bitmap, int64_t sector); > > void bdrv_set_dirty_bitmap(BdrvDirtyBitmap *bitmap, > > > -- > Best regards, > Vladimir > * now, @virtuozzo.com instead of @parallels.com. Sorry for this inconvenience. >
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index d75dcf7..de143f1 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -153,6 +153,16 @@ void bdrv_dirty_bitmap_reset_meta(BlockDriverState *bs, hbitmap_reset(bitmap->meta, sector, nb_sectors); } +int64_t bdrv_dirty_bitmap_size(BdrvDirtyBitmap *bitmap) +{ + return bitmap->size; +} + +const char *bdrv_dirty_bitmap_name(BdrvDirtyBitmap *bitmap) +{ + return bitmap->name; +} + bool bdrv_dirty_bitmap_frozen(BdrvDirtyBitmap *bitmap) { return bitmap->successor; diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h index d9b281a..8c29c3e 100644 --- a/include/block/dirty-bitmap.h +++ b/include/block/dirty-bitmap.h @@ -32,6 +32,8 @@ uint32_t bdrv_get_default_bitmap_granularity(BlockDriverState *bs); uint32_t bdrv_dirty_bitmap_granularity(BdrvDirtyBitmap *bitmap); bool bdrv_dirty_bitmap_enabled(BdrvDirtyBitmap *bitmap); bool bdrv_dirty_bitmap_frozen(BdrvDirtyBitmap *bitmap); +const char *bdrv_dirty_bitmap_name(BdrvDirtyBitmap *bitmap); +int64_t bdrv_dirty_bitmap_size(BdrvDirtyBitmap *bitmap); DirtyBitmapStatus bdrv_dirty_bitmap_status(BdrvDirtyBitmap *bitmap); int bdrv_get_dirty(BlockDriverState *bs, BdrvDirtyBitmap *bitmap, int64_t sector); void bdrv_set_dirty_bitmap(BdrvDirtyBitmap *bitmap,