qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>, qemu-block@nongnu.org
Cc: kwolf@redhat.com, mreitz@redhat.com, qemu-devel@nongnu.org,
	armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH] blockdev: fix bitmap clear undo
Date: Wed, 15 Mar 2017 17:14:57 -0500	[thread overview]
Message-ID: <023c6458-07bb-8582-5452-b7d3eea70bee@redhat.com> (raw)
In-Reply-To: <20170315212811.15937-1-jsnow@redhat.com>

[-- 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 --]

  reply	other threads:[~2017-03-15 22:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 21:28 [Qemu-devel] [PATCH] blockdev: fix bitmap clear undo John Snow
2017-03-15 22:14 ` Eric Blake [this message]
2017-03-16  9:00 ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=023c6458-07bb-8582-5452-b7d3eea70bee@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).