aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2019-03-12 12:05:49 -0400
committerJohn Snow <jsnow@redhat.com>2019-03-12 12:05:49 -0400
commit0064cfefa4e90c11e394befb7abe47602f2f30d7 (patch)
tree1bf04a71c89e4d51b487d9b14d5cdcff88651926 /block
parentb0f455599d0f092abc11aa3daba693be1453d29a (diff)
block/dirty-bitmap: add inconsistent status
Even though the status field is deprecated, we still have to support it for a few more releases. Since this is a very new kind of bitmap state, it makes sense for it to have its own status field. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20190301191545.8728-3-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/dirty-bitmap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index 096c1b7d71..4a2349d9dd 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -210,10 +210,15 @@ bool bdrv_dirty_bitmap_enabled(BdrvDirtyBitmap *bitmap)
* or it can be Disabled and not recording writes.
* (4) Locked: Whether Active or Disabled, the user cannot modify this bitmap
* in any way from the monitor.
+ * (5) Inconsistent: This is a persistent bitmap whose "in use" bit is set, and
+ * is unusable by QEMU. It can be deleted to remove it from
+ * the qcow2.
*/
DirtyBitmapStatus bdrv_dirty_bitmap_status(BdrvDirtyBitmap *bitmap)
{
- if (bdrv_dirty_bitmap_has_successor(bitmap)) {
+ if (bdrv_dirty_bitmap_inconsistent(bitmap)) {
+ return DIRTY_BITMAP_STATUS_INCONSISTENT;
+ } else if (bdrv_dirty_bitmap_has_successor(bitmap)) {
return DIRTY_BITMAP_STATUS_FROZEN;
} else if (bdrv_dirty_bitmap_busy(bitmap)) {
return DIRTY_BITMAP_STATUS_LOCKED;