aboutsummaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'job.c')
-rw-r--r--job.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/job.c b/job.c
index eede6802ae..7cd3602782 100644
--- a/job.c
+++ b/job.c
@@ -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);