All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, jsnow@redhat.com, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: early check for blockers on drive-mirror
Date: Thu, 8 Feb 2018 09:17:05 +0800	[thread overview]
Message-ID: <20180208011705.GA24289@lemon.usersys.redhat.com> (raw)
In-Reply-To: <20180207162920.28386-1-pbonzini@redhat.com>

On Wed, 02/07 17:29, Paolo Bonzini wrote:
> Even if an op blocker is present for BLOCK_OP_TYPE_MIRROR_SOURCE,
> it is checked a bit late and the result is that the target is
> created even if drive-mirror subsequently fails.  Add an early
> check to avoid this.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  blockdev.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/blockdev.c b/blockdev.c
> index 8e977eef11..c7e2e0a00e 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -3565,6 +3565,11 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
>          return;
>      }
>  
> +    /* Early check to avoid creating target */
> +    if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_MIRROR_SOURCE, errp)) {
> +        return;
> +    }
> +
>      aio_context = bdrv_get_aio_context(bs);
>      aio_context_acquire(aio_context);
>  
> -- 
> 2.14.3
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

  reply	other threads:[~2018-02-08  1:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 16:29 [Qemu-devel] [PATCH] block: early check for blockers on drive-mirror Paolo Bonzini
2018-02-08  1:17 ` Fam Zheng [this message]
2018-02-08 10:10 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2018-02-08 10:38   ` Paolo Bonzini
2018-02-08 12:41 ` Alberto Garcia
2018-02-09 15:36 ` Kevin Wolf
2018-02-09 23:07 ` [Qemu-devel] " John Snow
2018-02-12  9:58   ` Paolo Bonzini
2018-02-12 10:02     ` Daniel P. Berrangé
2018-02-12 12:42       ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2018-02-12 12:49         ` Daniel P. Berrangé

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=20180208011705.GA24289@lemon.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.