qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/1] Block QAPI, monitor, command line patches
@ 2015-05-29 11:07 Markus Armbruster
  2015-05-29 11:07 ` [Qemu-devel] [PULL 1/1] qapi: add dirty bitmap status Markus Armbruster
  2015-05-29 16:10 ` [Qemu-devel] [PULL 0/1] Block QAPI, monitor, command line patches Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Markus Armbruster @ 2015-05-29 11:07 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit ba7c388963e099c0d2cedb7f048e30747ffff25d:

  Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20150529-1' into staging (2015-05-29 10:17:49 +0100)

are available in the git repository at:


  git://repo.or.cz/qemu/armbru.git tags/pull-block-2015-05-29

for you to fetch changes up to 9abe3bdc45ced367fe034c0fdd7c686212389767:

  qapi: add dirty bitmap status (2015-05-29 12:53:12 +0200)

----------------------------------------------------------------
Block QAPI, monitor, command line patches

----------------------------------------------------------------
John Snow (1):
      qapi: add dirty bitmap status

 block.c               | 13 ++++++++++++-
 include/block/block.h |  1 +
 qapi/block-core.json  | 23 +++++++++++++++++++++--
 3 files changed, 34 insertions(+), 3 deletions(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PULL 1/1] qapi: add dirty bitmap status
  2015-05-29 11:07 [Qemu-devel] [PULL 0/1] Block QAPI, monitor, command line patches Markus Armbruster
@ 2015-05-29 11:07 ` Markus Armbruster
  2015-05-29 16:10 ` [Qemu-devel] [PULL 0/1] Block QAPI, monitor, command line patches Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Armbruster @ 2015-05-29 11:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow

From: John Snow <jsnow@redhat.com>

Bitmaps can be in a handful of different states with potentially
more to come as we tool around with migration and persistence patches.

Management applications may need to know why certain bitmaps are
unavailable for various commands, e.g. busy in another operation,
busy being migrated, etc.

Right now, all we offer is BlockDirtyInfo's boolean member 'frozen'.
Instead of adding more booleans, replace it by an enumeration member
'status' with values 'active' and 'frozen'.  Then add new value
'disabled'.

Incompatible change.  Fine because the changed part hasn't been
released so far.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 block.c               | 13 ++++++++++++-
 include/block/block.h |  1 +
 qapi/block-core.json  | 23 +++++++++++++++++++++--
 3 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/block.c b/block.c
index f42d70e..2b9ceae 100644
--- a/block.c
+++ b/block.c
@@ -3116,6 +3116,17 @@ bool bdrv_dirty_bitmap_enabled(BdrvDirtyBitmap *bitmap)
     return !(bitmap->disabled || bitmap->successor);
 }
 
+DirtyBitmapStatus bdrv_dirty_bitmap_status(BdrvDirtyBitmap *bitmap)
+{
+    if (bdrv_dirty_bitmap_frozen(bitmap)) {
+        return DIRTY_BITMAP_STATUS_FROZEN;
+    } else if (!bdrv_dirty_bitmap_enabled(bitmap)) {
+        return DIRTY_BITMAP_STATUS_DISABLED;
+    } else {
+        return DIRTY_BITMAP_STATUS_ACTIVE;
+    }
+}
+
 /**
  * Create a successor bitmap destined to replace this bitmap after an operation.
  * Requires that the bitmap is not frozen and has no successor.
@@ -3256,7 +3267,7 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs)
         info->granularity = bdrv_dirty_bitmap_granularity(bm);
         info->has_name = !!bm->name;
         info->name = g_strdup(bm->name);
-        info->frozen = bdrv_dirty_bitmap_frozen(bm);
+        info->status = bdrv_dirty_bitmap_status(bm);
         entry->value = info;
         *plist = entry;
         plist = &entry->next;
diff --git a/include/block/block.h b/include/block/block.h
index c1c963e..f7680b6 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -476,6 +476,7 @@ 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);
+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,
                            int64_t cur_sector, int nr_sectors);
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 863ffea..8411d4f 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -326,6 +326,25 @@
             'data': 'bool', '*offset': 'int' } }
 
 ##
+# @DirtyBitmapStatus:
+#
+# An enumeration of possible states that a dirty bitmap can report to the user.
+#
+# @frozen: The bitmap is currently in-use by a backup operation or block job,
+#          and is immutable.
+#
+# @disabled: The bitmap is currently in-use by an internal operation and is
+#            read-only. It can still be deleted.
+#
+# @active: The bitmap is actively monitoring for new writes, and can be cleared,
+#          deleted, or used for backup operations.
+#
+# Since: 2.4
+##
+{ 'enum': 'DirtyBitmapStatus',
+  'data': ['active', 'disabled', 'frozen'] }
+
+##
 # @BlockDirtyInfo:
 #
 # Block dirty bitmap information.
@@ -336,13 +355,13 @@
 #
 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
 #
-# @frozen: whether the dirty bitmap is frozen (Since 2.4)
+# @status: current status of the dirty bitmap (since 2.4)
 #
 # Since: 1.3
 ##
 { 'struct': 'BlockDirtyInfo',
   'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
-           'frozen': 'bool'} }
+           'status': 'DirtyBitmapStatus'} }
 
 ##
 # @BlockInfo:
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PULL 0/1] Block QAPI, monitor, command line patches
  2015-05-29 11:07 [Qemu-devel] [PULL 0/1] Block QAPI, monitor, command line patches Markus Armbruster
  2015-05-29 11:07 ` [Qemu-devel] [PULL 1/1] qapi: add dirty bitmap status Markus Armbruster
@ 2015-05-29 16:10 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-05-29 16:10 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: QEMU Developers

On 29 May 2015 at 12:07, Markus Armbruster <armbru@redhat.com> wrote:
> The following changes since commit ba7c388963e099c0d2cedb7f048e30747ffff25d:
>
>   Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20150529-1' into staging (2015-05-29 10:17:49 +0100)
>
> are available in the git repository at:
>
>
>   git://repo.or.cz/qemu/armbru.git tags/pull-block-2015-05-29
>
> for you to fetch changes up to 9abe3bdc45ced367fe034c0fdd7c686212389767:
>
>   qapi: add dirty bitmap status (2015-05-29 12:53:12 +0200)
>
> ----------------------------------------------------------------
> Block QAPI, monitor, command line patches

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-29 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29 11:07 [Qemu-devel] [PULL 0/1] Block QAPI, monitor, command line patches Markus Armbruster
2015-05-29 11:07 ` [Qemu-devel] [PULL 1/1] qapi: add dirty bitmap status Markus Armbruster
2015-05-29 16:10 ` [Qemu-devel] [PULL 0/1] Block QAPI, monitor, command line patches Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).