From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH for-6.1? v2 4/7] jobs: Give Job.force_cancel more meaning
Date: Mon, 26 Jul 2021 16:38:53 -0500 [thread overview]
Message-ID: <20210726213853.n7pp5sklriztmn7g@redhat.com> (raw)
In-Reply-To: <20210726144613.954844-5-mreitz@redhat.com>
On Mon, Jul 26, 2021 at 04:46:10PM +0200, Max Reitz wrote:
> We largely have two cancel modes for jobs:
>
> First, there is actual cancelling. The job is terminated as soon as
> possible, without trying to reach a consistent result.
>
> Second, we have mirror in the READY state. Technically, the job is not
> really cancelled, but it just is a different completion mode. The job
> can still run for an indefinite amount of time while it tries to reach a
> consistent result.
>
> We want to be able to clearly distinguish which cancel mode a job is in
> (when it has been cancelled). We can use Job.force_cancel for this, but
> right now it only reflects cancel requests from the user with
> force=true, but clearly, jobs that do not even distinguish between
> force=false and force=true are effectively always force-cancelled.
>
> So this patch has Job.force_cancel signify whether the job will
> terminate as soon as possible (force_cancel=true) or whether it will
> effectively remain running despite being "cancelled"
> (force_cancel=false).
>
> To this end, we let jobs that provide JobDriver.cancel() tell the
> generic job code whether they will terminate as soon as possible or not,
> and for jobs that do not provide that method we assume they will.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> include/qemu/job.h | 11 ++++++++++-
> block/backup.c | 3 ++-
> block/mirror.c | 24 ++++++++++++++++++------
> job.c | 6 +++++-
> 4 files changed, 35 insertions(+), 9 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2021-07-26 21:39 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 14:46 [PATCH for-6.1? v2 0/7] mirror: Handle errors after READY cancel Max Reitz
2021-07-26 14:46 ` [PATCH for-6.1? v2 1/7] mirror: Keep s->synced on error Max Reitz
2021-07-26 14:46 ` [PATCH for-6.1? v2 2/7] mirror: Drop s->synced Max Reitz
2021-07-26 15:26 ` Eric Blake
2021-07-27 11:41 ` Vladimir Sementsov-Ogievskiy
2021-07-26 14:46 ` [PATCH for-6.1? v2 3/7] job: @force parameter for job_cancel_sync{, _all}() Max Reitz
2021-08-03 14:00 ` [PATCH for-6.1? v2 3/7] job: @force parameter for job_cancel_sync{,_all}() Kevin Wolf
2021-07-26 14:46 ` [PATCH for-6.1? v2 4/7] jobs: Give Job.force_cancel more meaning Max Reitz
2021-07-26 21:38 ` Eric Blake [this message]
2021-07-27 12:40 ` Vladimir Sementsov-Ogievskiy
2021-07-26 14:46 ` [PATCH for-6.1? v2 5/7] job: Add job_cancel_requested() Max Reitz
2021-07-27 13:04 ` Vladimir Sementsov-Ogievskiy
2021-07-27 15:39 ` Max Reitz
2021-07-27 15:47 ` Vladimir Sementsov-Ogievskiy
2021-08-02 10:23 ` Max Reitz
2021-08-03 12:35 ` Vladimir Sementsov-Ogievskiy
2021-08-03 14:25 ` Kevin Wolf
2021-08-04 8:07 ` Max Reitz
2021-08-04 10:34 ` Kevin Wolf
2021-08-04 11:00 ` Peter Krempa
2021-08-04 14:15 ` Max Reitz
2021-07-26 14:46 ` [PATCH for-6.1? v2 6/7] mirror: Check job_is_cancelled() earlier Max Reitz
2021-07-27 13:13 ` Vladimir Sementsov-Ogievskiy
2021-07-27 15:40 ` Max Reitz
2021-08-03 14:34 ` Kevin Wolf
2021-08-04 8:25 ` Max Reitz
2021-08-04 9:48 ` Kevin Wolf
2021-08-04 10:12 ` Max Reitz
2021-07-26 14:46 ` [PATCH for-6.1? v2 7/7] iotests: Add mirror-ready-cancel-error test Max Reitz
2021-07-27 13:24 ` Vladimir Sementsov-Ogievskiy
2021-08-03 14:36 ` [PATCH for-6.1? v2 0/7] mirror: Handle errors after READY cancel Kevin Wolf
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=20210726213853.n7pp5sklriztmn7g@redhat.com \
--to=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).