From: Hanna Reitz Date: Wed, 6 Oct 2021 15:19:36 +0000 (+0200) Subject: mirror: Use job_is_cancelled() X-Git-Tag: qemu-xen-4.17.0-rc4~294^2~4 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=20ad4d204accb27346b05b046ee8225c6725ef49;p=qemu-xen.git 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 Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20211006151940.214590-10-hreitz@redhat.com> Signed-off-by: Vladimir Sementsov-Ogievskiy --- diff --git a/block/mirror.c b/block/mirror.c index 2d9642cb00..0eaba88060 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; }