From 9abe3bdc45ced367fe034c0fdd7c686212389767 Mon Sep 17 00:00:00 2001 From: John Snow Date: Tue, 12 May 2015 15:53:01 -0400 Subject: qapi: add dirty bitmap status 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 Signed-off-by: John Snow Reviewed-by: Eric Blake [Commit message tweaked] Signed-off-by: Markus Armbruster --- qapi/block-core.json | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'qapi') diff --git a/qapi/block-core.json b/qapi/block-core.json index 863ffea0c7..8411d4f83a 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -325,6 +325,25 @@ 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool', '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: # @@ -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: -- cgit v1.2.3-55-g7522