qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [PULL 09/10] job: Allow complete for jobs on standby
Date: Fri,  9 Apr 2021 18:15:47 +0200	[thread overview]
Message-ID: <20210409161548.341297-10-kwolf@redhat.com> (raw)
In-Reply-To: <20210409161548.341297-1-kwolf@redhat.com>

From: Max Reitz <mreitz@redhat.com>

The only job that implements .complete is the mirror job, and it can
handle completion requests just fine while the job is paused.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1945635
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210409120422.144040-4-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 job.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/job.c b/job.c
index 289edee143..4aff13d95a 100644
--- a/job.c
+++ b/job.c
@@ -56,7 +56,7 @@ bool JobVerbTable[JOB_VERB__MAX][JOB_STATUS__MAX] = {
     [JOB_VERB_PAUSE]                = {0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0},
     [JOB_VERB_RESUME]               = {0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0},
     [JOB_VERB_SET_SPEED]            = {0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0},
-    [JOB_VERB_COMPLETE]             = {0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
+    [JOB_VERB_COMPLETE]             = {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
     [JOB_VERB_FINALIZE]             = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0},
     [JOB_VERB_DISMISS]              = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
 };
@@ -991,7 +991,7 @@ void job_complete(Job *job, Error **errp)
     if (job_apply_verb(job, JOB_VERB_COMPLETE, errp)) {
         return;
     }
-    if (job->pause_count || job_is_cancelled(job) || !job->driver->complete) {
+    if (job_is_cancelled(job) || !job->driver->complete) {
         error_setg(errp, "The active block job '%s' cannot be completed",
                    job->id);
         return;
-- 
2.30.2



  parent reply	other threads:[~2021-04-09 16:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 16:15 [PULL 00/10] Block layer fixes for 6.0-rc3 Kevin Wolf
2021-04-09 16:15 ` [PULL 01/10] block/rbd: fix memory leak in qemu_rbd_connect() Kevin Wolf
2021-04-09 16:15 ` [PULL 02/10] block/rbd: fix memory leak in qemu_rbd_co_create_opts() Kevin Wolf
2021-04-09 16:15 ` [PULL 03/10] iotests/qsd-jobs: Filter events in the first test Kevin Wolf
2021-04-09 16:15 ` [PULL 04/10] iotests: add test for removing persistent bitmap from backing file Kevin Wolf
2021-04-09 16:15 ` [PULL 05/10] iotests: Test mirror-top filter permissions Kevin Wolf
2021-04-09 16:15 ` [PULL 06/10] hw/block/fdc: Fix 'fallback' property on sysbus floppy disk controllers Kevin Wolf
2021-04-09 16:15 ` [PULL 07/10] mirror: Move open_backing_file to exit_common Kevin Wolf
2021-04-09 16:15 ` [PULL 08/10] mirror: Do not enter a paused job on completion Kevin Wolf
2021-04-09 16:15 ` Kevin Wolf [this message]
2021-04-09 16:15 ` [PULL 10/10] test-blockjob: Test job_wait_unpaused() Kevin Wolf
2021-04-10 15:58 ` [PULL 00/10] Block layer fixes for 6.0-rc3 Peter Maydell

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=20210409161548.341297-10-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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 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).