diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-04-24 17:10:12 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-23 14:30:51 +0200 |
commit | 5f9a6a08e8f65e01746d2485fc65a3a78e74865f (patch) | |
tree | 48101bce5087ce23d966590f75d9697f837e0b0a /job.c | |
parent | 198c49cc8d81e8eb0df3749d395599895c3a3a76 (diff) |
job: Add job_dismiss()
This moves block_job_dismiss() to the Job layer.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'job.c')
-rw-r--r-- | job.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -568,7 +568,7 @@ void job_user_resume(Job *job, Error **errp) job_resume(job); } -void job_do_dismiss(Job *job) +static void job_do_dismiss(Job *job) { assert(job); job->busy = false; @@ -581,6 +581,19 @@ void job_do_dismiss(Job *job) job_unref(job); } +void job_dismiss(Job **jobptr, Error **errp) +{ + Job *job = *jobptr; + /* similarly to _complete, this is QMP-interface only. */ + assert(job->id); + if (job_apply_verb(job, JOB_VERB_DISMISS, errp)) { + return; + } + + job_do_dismiss(job); + *jobptr = NULL; +} + void job_early_fail(Job *job) { assert(job->status == JOB_STATUS_CREATED); |