aboutsummaryrefslogtreecommitdiff
path: root/block/mirror.c
diff options
context:
space:
mode:
authorHanna Reitz <hreitz@redhat.com>2021-10-06 17:19:36 +0200
committerVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-10-07 10:42:50 +0200
commit20ad4d204accb27346b05b046ee8225c6725ef49 (patch)
treeb2b47fe625853804335c229ef3feaacde27bb1c9 /block/mirror.c
parent08b83bff2a77e082d0b29680a40f0aaf9996bd16 (diff)
downloadqemu-20ad4d204accb27346b05b046ee8225c6725ef49.zip
qemu-20ad4d204accb27346b05b046ee8225c6725ef49.tar.gz
qemu-20ad4d204accb27346b05b046ee8225c6725ef49.tar.bz2
mirror: Use job_is_cancelled()
mirror_drained_poll() returns true whenever the job is cancelled, because "we [can] be sure that it won't issue more requests". However, this is only true for force-cancelled jobs, so use job_is_cancelled(). Signed-off-by: Hanna Reitz <hreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20211006151940.214590-10-hreitz@redhat.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Diffstat (limited to 'block/mirror.c')
-rw-r--r--block/mirror.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/mirror.c b/block/mirror.c
index 2d9642c..0eaba88 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1184,7 +1184,7 @@ static bool mirror_drained_poll(BlockJob *job)
* from one of our own drain sections, to avoid a deadlock waiting for
* ourselves.
*/
- if (!s->common.job.paused && !s->common.job.cancelled && !s->in_drain) {
+ if (!s->common.job.paused && !job_is_cancelled(&job->job) && !s->in_drain) {
return true;
}