On Wed, Oct 06, 2021 at 05:19:34PM +0200, Hanna Reitz wrote: > The only job that supports a soft cancel mode is the mirror job, and in > such a case it resets its .cancelled field before it leaves its .run() > function, so it does not really count as cancelled. > > However, it is possible to cancel the job after .run() returns and > before job_exit() (which is run in the main loop) is executed. Then, > .cancelled would still be true and the job would count as cancelled. > This does not seem to be in the interest of the mirror job, so adjust > job_cancel_async() to not set .cancelled in such a case, and > job_cancel() to not invoke job_completed_txn_abort(). > > Signed-off-by: Hanna Reitz <hre...@redhat.com> > --- > job.c | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) >
Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org