]> Git Repo - qemu.git/commitdiff
block: for jobs, do not clear user_paused until after the resume
authorJeff Cody <[email protected]>
Tue, 21 Aug 2018 16:26:19 +0000 (12:26 -0400)
committerJeff Cody <[email protected]>
Tue, 21 Aug 2018 18:59:30 +0000 (14:59 -0400)
The function job_cancel_async() will always cause an assert for blockjob
user resume.  We set job->user_paused to false, and then call
job->driver->user_resume().  In the case of blockjobs, this is the
block_job_user_resume() function.

In that function, we assert that job.user_paused is set to true.
Unfortunately, right before calling this function, it has explicitly
been set to false.

The fix is pretty simple: set job->user_paused to false only after the
job user_resume() function has been called.

Reviewed-by: John Snow <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Jeff Cody <[email protected]>
Message-id: bb183b77d8f2dd6bd67b8da559a90ac1e74b2052.1534868459[email protected]
Signed-off-by: Jeff Cody <[email protected]>
job.c

diff --git a/job.c b/job.c
index fa671b431a45754ff118229b1fa12130de7ac6d5..e36ebaafd81c2cb2cc5a7ed7e46a20704f96fe6e 100644 (file)
--- a/job.c
+++ b/job.c
@@ -732,10 +732,10 @@ static void job_cancel_async(Job *job, bool force)
 {
     if (job->user_paused) {
         /* Do not call job_enter here, the caller will handle it.  */
-        job->user_paused = false;
         if (job->driver->user_resume) {
             job->driver->user_resume(job);
         }
+        job->user_paused = false;
         assert(job->pause_count > 0);
         job->pause_count--;
     }
This page took 0.027802 seconds and 4 git commands to generate.