* [Qemu-devel] [PATCH] blockdev: fix bitmap clear undo
@ 2017-03-15 21:28 John Snow
2017-03-15 22:14 ` Eric Blake
2017-03-16 9:00 ` Kevin Wolf
0 siblings, 2 replies; 3+ messages in thread
From: John Snow @ 2017-03-15 21:28 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, qemu-devel, armbru, mreitz, John Snow
Only undo the action if we actually prepared the action.
Signed-off-by: John Snow <jsnow@redhat.com>
---
blockdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/blockdev.c b/blockdev.c
index f1f49bd..c5b2c2c 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)
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] blockdev: fix bitmap clear undo
2017-03-15 21:28 [Qemu-devel] [PATCH] blockdev: fix bitmap clear undo John Snow
@ 2017-03-15 22:14 ` Eric Blake
2017-03-16 9:00 ` Kevin Wolf
1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2017-03-15 22:14 UTC (permalink / raw)
To: John Snow, qemu-block; +Cc: kwolf, mreitz, qemu-devel, armbru
[-- Attachment #1: Type: text/plain, Size: 1013 bytes --]
On 03/15/2017 04:28 PM, John Snow wrote:
> Only undo the action if we actually prepared the action.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> blockdev.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/blockdev.c b/blockdev.c
> index f1f49bd..c5b2c2c 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)
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] blockdev: fix bitmap clear undo
2017-03-15 21:28 [Qemu-devel] [PATCH] blockdev: fix bitmap clear undo John Snow
2017-03-15 22:14 ` Eric Blake
@ 2017-03-16 9:00 ` Kevin Wolf
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2017-03-16 9:00 UTC (permalink / raw)
To: John Snow; +Cc: qemu-block, qemu-devel, armbru, mreitz
Am 15.03.2017 um 22:28 hat John Snow geschrieben:
> Only undo the action if we actually prepared the action.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-16 9:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-15 21:28 [Qemu-devel] [PATCH] blockdev: fix bitmap clear undo John Snow
2017-03-15 22:14 ` Eric Blake
2017-03-16 9:00 ` Kevin Wolf
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).