All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: early check for blockers on drive-mirror
@ 2018-02-07 16:29 Paolo Bonzini
  2018-02-08  1:17 ` Fam Zheng
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Paolo Bonzini @ 2018-02-07 16:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, jsnow

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-02-12 12:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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é

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.