aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2017-03-15 17:28:11 -0400
committerKevin Wolf <kwolf@redhat.com>2017-03-17 12:54:06 +0100
commit184dd9c49b522fe729cfe21d119f6db241268a50 (patch)
treea648717342901310c510e6971e644ed5af4fe0bf
parentc1cef67251d3e6ae275c0898ccf4cbcfe85d4e0b (diff)
blockdev: fix bitmap clear undo
Only undo the action if we actually prepared the action. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--blockdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/blockdev.c b/blockdev.c
index f1f49bd3ca..c5b2c2c209 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2047,7 +2047,9 @@ static void block_dirty_bitmap_clear_abort(BlkActionState *common)
BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,
common, common);
- bdrv_undo_clear_dirty_bitmap(state->bitmap, state->backup);
+ if (state->backup) {
+ bdrv_undo_clear_dirty_bitmap(state->bitmap, state->backup);
+ }
}
static void block_dirty_bitmap_clear_commit(BlkActionState *common)