job: Add job_transition_to_ready()

The transition to the READY state was still performed in the BlockJob
layer, in the same function that sent the BLOCK_JOB_READY QMP event.

This patch brings the state transition to the Job layer and implements
the QMP event using a notifier called from the Job layer, like we
already do for other events related to state transitions.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Kevin Wolf 2018-04-25 14:56:09 +02:00
parent df956ae201
commit 2e1795b581
8 changed files with 45 additions and 34 deletions

View file

@ -186,7 +186,7 @@ static void coroutine_fn cancel_job_start(void *opaque)
}
if (!job_is_ready(&s->common.job) && s->should_converge) {
block_job_event_ready(&s->common);
job_transition_to_ready(&s->common.job);
}
job_sleep_ns(&s->common.job, 100000);