[Qemu-devel] [PATCH] dirty-bitmap: Expose persistent flag to 'query-block'

Eric Blake posted 1 patch 5 years, 1 month ago
Failed in applying to current master (apply log)
There is a newer version of this series
qapi/block-core.json | 5 ++++-
block/dirty-bitmap.c | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
[Qemu-devel] [PATCH] dirty-bitmap: Expose persistent flag to 'query-block'
Posted by Eric Blake 5 years, 1 month ago
Since qemu currently doesn't flush persistent bitmaps to disk until
shutdown (which might be MUCH later), it's useful if 'query-block'
at least shows WHICH bitmaps will (eventually) make it to persistent
storage.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 qapi/block-core.json | 5 ++++-
 block/dirty-bitmap.c | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/qapi/block-core.json b/qapi/block-core.json
index dae5c7b4d83..2e0bd3c245a 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -450,11 +450,14 @@
 #
 # @status: current status of the dirty bitmap (since 2.4)
 #
+# @persistent: true if the bitmap will eventually be flushed to persistent
+#              storage (since 4.0)
+#
 # Since: 1.3
 ##
 { 'struct': 'BlockDirtyInfo',
   'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
-           'status': 'DirtyBitmapStatus'} }
+           'status': 'DirtyBitmapStatus', 'persistent': 'bool' } }

 ##
 # @Qcow2BitmapInfoFlags:
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index 00ea36f5545..e46f72b346c 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -440,6 +440,7 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs)
         info->has_name = !!bm->name;
         info->name = g_strdup(bm->name);
         info->status = bdrv_dirty_bitmap_status(bm);
+        info->persistent = bm->persistent;
         entry->value = info;
         *plist = entry;
         plist = &entry->next;
-- 
2.20.1


Re: [Qemu-devel] [PATCH] dirty-bitmap: Expose persistent flag to 'query-block'
Posted by Vladimir Sementsov-Ogievskiy 5 years, 1 month ago
04.02.2019 19:09, Eric Blake wrote:
> Since qemu currently doesn't flush persistent bitmaps to disk until
> shutdown (which might be MUCH later), it's useful if 'query-block'
> at least shows WHICH bitmaps will (eventually) make it to persistent
> storage.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>



-- 
Best regards,
Vladimir
Re: [Qemu-devel] [PATCH] dirty-bitmap: Expose persistent flag to 'query-block'
Posted by John Snow 5 years, 1 month ago

On 2/4/19 11:09 AM, Eric Blake wrote:
> Since qemu currently doesn't flush persistent bitmaps to disk until
> shutdown (which might be MUCH later), it's useful if 'query-block'
> at least shows WHICH bitmaps will (eventually) make it to persistent
> storage.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>

Agree that we want this anyway.

Reviewed-by: John Snow <jsnow@redhat.com>

Re: [Qemu-devel] [PATCH] dirty-bitmap: Expose persistent flag to 'query-block'
Posted by John Snow 5 years, 1 month ago

On 2/4/19 11:09 AM, Eric Blake wrote:
> Since qemu currently doesn't flush persistent bitmaps to disk until
> shutdown (which might be MUCH later), it's useful if 'query-block'
> at least shows WHICH bitmaps will (eventually) make it to persistent
> storage.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>  qapi/block-core.json | 5 ++++-
>  block/dirty-bitmap.c | 1 +
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index dae5c7b4d83..2e0bd3c245a 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -450,11 +450,14 @@
>  #
>  # @status: current status of the dirty bitmap (since 2.4)
>  #
> +# @persistent: true if the bitmap will eventually be flushed to persistent
> +#              storage (since 4.0)
> +#
>  # Since: 1.3
>  ##
>  { 'struct': 'BlockDirtyInfo',
>    'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
> -           'status': 'DirtyBitmapStatus'} }
> +           'status': 'DirtyBitmapStatus', 'persistent': 'bool' } }
> 
>  ##
>  # @Qcow2BitmapInfoFlags:
> diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
> index 00ea36f5545..e46f72b346c 100644
> --- a/block/dirty-bitmap.c
> +++ b/block/dirty-bitmap.c
> @@ -440,6 +440,7 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs)
>          info->has_name = !!bm->name;
>          info->name = g_strdup(bm->name);
>          info->status = bdrv_dirty_bitmap_status(bm);
> +        info->persistent = bm->persistent;
>          entry->value = info;
>          *plist = entry;
>          plist = &entry->next;
> 

Oh, this needs a change to 236, too.

--js