aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-04-25 14:56:09 +0200
committerKevin Wolf <kwolf@redhat.com>2018-05-23 14:30:51 +0200
commit2e1795b58131427719c7cd11f8b9b6984b3f24f8 (patch)
treed9e0c9842af8c71f9aa40c56599c880a88ca7535 /tests
parentdf956ae2014340bf7de0190edb1d09be55d9eadf (diff)
downloadqemu-2e1795b58131427719c7cd11f8b9b6984b3f24f8.zip
qemu-2e1795b58131427719c7cd11f8b9b6984b3f24f8.tar.gz
qemu-2e1795b58131427719c7cd11f8b9b6984b3f24f8.tar.bz2
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-bdrv-drain.c2
-rw-r--r--tests/test-blockjob.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c
index 3600ffd..2cba63b 100644
--- a/tests/test-bdrv-drain.c
+++ b/tests/test-bdrv-drain.c
@@ -505,7 +505,7 @@ static void coroutine_fn test_job_start(void *opaque)
{
TestBlockJob *s = opaque;
- block_job_event_ready(&s->common);
+ job_transition_to_ready(&s->common.job);
while (!s->should_complete) {
job_sleep_ns(&s->common.job, 100000);
}
diff --git a/tests/test-blockjob.c b/tests/test-blockjob.c
index 8180d03..e408d52 100644
--- a/tests/test-blockjob.c
+++ b/tests/test-blockjob.c
@@ -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);