From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
Jeff Cody <jcody@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
John Snow <jsnow@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] block/mirror: Make cancel always cancel pre-READY
Date: Wed, 2 May 2018 00:05:08 +0200 [thread overview]
Message-ID: <20180501220509.14152-2-mreitz@redhat.com> (raw)
In-Reply-To: <20180501220509.14152-1-mreitz@redhat.com>
Commit b76e4458b1eb3c32e9824fe6aa51f67d2b251748 made the mirror block
job respect block-job-cancel's @force flag: With that flag set, it would
now always really cancel, even post-READY.
Unfortunately, it had a side effect: Without that flag set, it would now
never cancel, not even before READY. Considering that is an
incompatible change and not noted anywhere in the commit or the
description of block-job-cancel's @force parameter, this seems
unintentional and we should revert to the previous behavior, which is to
immediately cancel the job when block-job-cancel is called before source
and target are in sync (i.e. before the READY event).
Cc: qemu-stable@nongnu.org
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1572856
Reported-by: Yanan Fu <yfu@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block/mirror.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/mirror.c b/block/mirror.c
index 7bfad6e844..003f957b12 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -874,7 +874,9 @@ static void coroutine_fn mirror_run(void *opaque)
}
trace_mirror_before_sleep(s, cnt, s->synced, delay_ns);
block_job_sleep_ns(&s->common, delay_ns);
- if (block_job_is_cancelled(&s->common) && s->common.force) {
+ if (block_job_is_cancelled(&s->common) &&
+ (!s->synced || s->common.force))
+ {
break;
}
s->last_pause_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
--
2.14.3
next prev parent reply other threads:[~2018-05-01 22:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-01 22:05 [Qemu-devel] [PATCH 0/2] block/mirror: Make cancel always cancel pre-READY Max Reitz
2018-05-01 22:05 ` Max Reitz [this message]
2018-05-01 23:31 ` [Qemu-devel] [PATCH 1/2] " Eric Blake
2018-05-02 12:35 ` Max Reitz
2018-05-01 22:05 ` [Qemu-devel] [PATCH 2/2] iotests: Add test for cancelling a mirror job Max Reitz
2018-05-02 14:31 ` Jeff Cody
2018-05-01 23:29 ` [Qemu-devel] [PATCH 0/2] block/mirror: Make cancel always cancel pre-READY Eric Blake
2018-05-02 14:32 ` Jeff Cody
2018-05-02 17:36 ` John Snow
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=20180501220509.14152-2-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=jcody@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@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.