|
|
7711c0 |
From de38b4dad0dfce73080295923dd3e2d863f6f855 Mon Sep 17 00:00:00 2001
|
|
|
7711c0 |
From: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
Date: Wed, 3 Apr 2019 18:18:38 +0200
|
|
|
7711c0 |
Subject: [PATCH 133/163] block/dirty-bitmap: Documentation and Comment fixups
|
|
|
7711c0 |
|
|
|
7711c0 |
RH-Author: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
Message-id: <20190403181857.9693-3-jsnow@redhat.com>
|
|
|
7711c0 |
Patchwork-id: 85416
|
|
|
7711c0 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 02/21] block/dirty-bitmap: Documentation and Comment fixups
|
|
|
7711c0 |
Bugzilla: 1677073
|
|
|
7711c0 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
The meaning of the states has changed subtly over time,
|
|
|
7711c0 |
this should bring the understanding more in-line with the
|
|
|
7711c0 |
current, actual usages.
|
|
|
7711c0 |
|
|
|
7711c0 |
Reported-by: Eric Blake <eblake@redhat.com>
|
|
|
7711c0 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
7711c0 |
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
|
|
|
7711c0 |
Message-id: 20190202011048.12343-1-jsnow@redhat.com
|
|
|
7711c0 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
(cherry picked from commit 73ab5d601c8b4311090a70e525f5970f70b8b2a0)
|
|
|
7711c0 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
---
|
|
|
7711c0 |
block/dirty-bitmap.c | 20 ++++++++++++++------
|
|
|
7711c0 |
qapi/block-core.json | 34 +++++++++++++++++++++++++---------
|
|
|
7711c0 |
2 files changed, 39 insertions(+), 15 deletions(-)
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
|
|
|
7711c0 |
index e46f72b..c6d4ace 100644
|
|
|
7711c0 |
--- a/block/dirty-bitmap.c
|
|
|
7711c0 |
+++ b/block/dirty-bitmap.c
|
|
|
7711c0 |
@@ -29,12 +29,20 @@
|
|
|
7711c0 |
#include "block/blockjob.h"
|
|
|
7711c0 |
|
|
|
7711c0 |
/**
|
|
|
7711c0 |
- * A BdrvDirtyBitmap can be in three possible states:
|
|
|
7711c0 |
- * (1) successor is NULL and disabled is false: full r/w mode
|
|
|
7711c0 |
- * (2) successor is NULL and disabled is true: read only mode ("disabled")
|
|
|
7711c0 |
- * (3) successor is set: frozen mode.
|
|
|
7711c0 |
- * A frozen bitmap cannot be renamed, deleted, anonymized, cleared, set,
|
|
|
7711c0 |
- * or enabled. A frozen bitmap can only abdicate() or reclaim().
|
|
|
7711c0 |
+ * A BdrvDirtyBitmap can be in four possible user-visible states:
|
|
|
7711c0 |
+ * (1) Active: successor is NULL, and disabled is false: full r/w mode
|
|
|
7711c0 |
+ * (2) Disabled: successor is NULL, and disabled is true: qualified r/w mode,
|
|
|
7711c0 |
+ * guest writes are dropped, but monitor writes are possible,
|
|
|
7711c0 |
+ * through commands like merge and clear.
|
|
|
7711c0 |
+ * (3) Frozen: successor is not NULL.
|
|
|
7711c0 |
+ * A frozen bitmap cannot be renamed, deleted, cleared, set,
|
|
|
7711c0 |
+ * enabled, merged to, etc. A frozen bitmap can only abdicate()
|
|
|
7711c0 |
+ * or reclaim().
|
|
|
7711c0 |
+ * In this state, the anonymous successor bitmap may be either
|
|
|
7711c0 |
+ * Active and recording writes from the guest (e.g. backup jobs),
|
|
|
7711c0 |
+ * but it can be Disabled and not recording writes.
|
|
|
7711c0 |
+ * (4) Locked: Whether Active or Disabled, the user cannot modify this bitmap
|
|
|
7711c0 |
+ * in any way from the monitor.
|
|
|
7711c0 |
*/
|
|
|
7711c0 |
struct BdrvDirtyBitmap {
|
|
|
7711c0 |
QemuMutex *mutex;
|
|
|
7711c0 |
diff --git a/qapi/block-core.json b/qapi/block-core.json
|
|
|
7711c0 |
index 23c9462..5fe7897 100644
|
|
|
7711c0 |
--- a/qapi/block-core.json
|
|
|
7711c0 |
+++ b/qapi/block-core.json
|
|
|
7711c0 |
@@ -421,17 +421,27 @@
|
|
|
7711c0 |
#
|
|
|
7711c0 |
# An enumeration of possible states that a dirty bitmap can report to the user.
|
|
|
7711c0 |
#
|
|
|
7711c0 |
-# @frozen: The bitmap is currently in-use by a backup operation or block job,
|
|
|
7711c0 |
-# and is immutable.
|
|
|
7711c0 |
-#
|
|
|
7711c0 |
-# @disabled: The bitmap is currently in-use by an internal operation and is
|
|
|
7711c0 |
-# read-only. It can still be deleted.
|
|
|
7711c0 |
+# @frozen: The bitmap is currently in-use by some operation and is immutable.
|
|
|
7711c0 |
+# If the bitmap was @active prior to the operation, new writes by the
|
|
|
7711c0 |
+# guest are being recorded in a temporary buffer, and will not be lost.
|
|
|
7711c0 |
+# Generally, bitmaps are cleared on successful use in an operation and
|
|
|
7711c0 |
+# the temporary buffer is committed into the bitmap. On failure, the
|
|
|
7711c0 |
+# temporary buffer is merged back into the bitmap without first
|
|
|
7711c0 |
+# clearing it.
|
|
|
7711c0 |
+# Please refer to the documentation for each bitmap-using operation,
|
|
|
7711c0 |
+# See also @blockdev-backup, @drive-backup.
|
|
|
7711c0 |
+#
|
|
|
7711c0 |
+# @disabled: The bitmap is not currently recording new writes by the guest.
|
|
|
7711c0 |
+# This is requested explicitly via @block-dirty-bitmap-disable.
|
|
|
7711c0 |
+# It can still be cleared, deleted, or used for backup operations.
|
|
|
7711c0 |
#
|
|
|
7711c0 |
# @active: The bitmap is actively monitoring for new writes, and can be cleared,
|
|
|
7711c0 |
# deleted, or used for backup operations.
|
|
|
7711c0 |
#
|
|
|
7711c0 |
-# @locked: The bitmap is currently in-use by some operation and can not be
|
|
|
7711c0 |
-# cleared, deleted, or used for backup operations. (Since 2.12)
|
|
|
7711c0 |
+# @locked: The bitmap is currently in-use by some operation and is immutable.
|
|
|
7711c0 |
+# If the bitmap was @active prior to the operation, it is still
|
|
|
7711c0 |
+# recording new writes. If the bitmap was @disabled, it is not
|
|
|
7711c0 |
+# recording new writes. (Since 2.12)
|
|
|
7711c0 |
#
|
|
|
7711c0 |
# Since: 2.4
|
|
|
7711c0 |
##
|
|
|
7711c0 |
@@ -1966,9 +1976,15 @@
|
|
|
7711c0 |
# @block-dirty-bitmap-merge:
|
|
|
7711c0 |
#
|
|
|
7711c0 |
# Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
|
|
|
7711c0 |
-# The @bitmaps dirty bitmaps are unchanged.
|
|
|
7711c0 |
+# Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
|
|
|
7711c0 |
+# as the @target bitmap. Any bits already set in @target will still be
|
|
|
7711c0 |
+# set after the merge, i.e., this operation does not clear the target.
|
|
|
7711c0 |
# On error, @target is unchanged.
|
|
|
7711c0 |
#
|
|
|
7711c0 |
+# The resulting bitmap will count as dirty any clusters that were dirty in any
|
|
|
7711c0 |
+# of the source bitmaps. This can be used to achieve backup checkpoints, or in
|
|
|
7711c0 |
+# simpler usages, to copy bitmaps.
|
|
|
7711c0 |
+#
|
|
|
7711c0 |
# Returns: nothing on success
|
|
|
7711c0 |
# If @node is not a valid block device, DeviceNotFound
|
|
|
7711c0 |
# If any bitmap in @bitmaps or @target is not found, GenericError
|
|
|
7711c0 |
@@ -2003,7 +2019,7 @@
|
|
|
7711c0 |
##
|
|
|
7711c0 |
# @x-debug-block-dirty-bitmap-sha256:
|
|
|
7711c0 |
#
|
|
|
7711c0 |
-# Get bitmap SHA256
|
|
|
7711c0 |
+# Get bitmap SHA256.
|
|
|
7711c0 |
#
|
|
|
7711c0 |
# Returns: BlockDirtyBitmapSha256 on success
|
|
|
7711c0 |
# If @node is not a valid block device, DeviceNotFound
|
|
|
7711c0 |
--
|
|
|
7711c0 |
1.8.3.1
|
|
|
7711c0 |
|