On 1/21/22 18:05, Emanuele Giuseppe Esposito wrote:
diff --git a/job.c b/job.c
index 39bf511949..cf0dc9325a 100644
--- a/job.c
+++ b/job.c
@@ -967,11 +967,24 @@ static void coroutine_fn job_co_entry(void *opaque)
aio_bh_schedule_oneshot(qemu_get_aio_context(), job_exit, job);
}
+static int job_pre_run(Job *job)
+{
+ assert(qemu_in_main_thread());
+ if (job->driver->pre_run) {
+ return job->driver->pre_run(job, &job->err);
+ }
+
+ return 0;
+}
+
void job_start(Job *job)
{
assert(job && !job_started(job) && job->paused &&
job->driver && job->driver->run);
job->co = qemu_coroutine_create(job_co_entry, job);
+ if (job_pre_run(job)) {
+ return;
+ }
job->pause_count--;
job->busy = true;
job->paused = false;
-- 2.31.1
This should have been in patch 31. Might not need a respin, unless
someone wants to have these three patches reorganized(*), still worth
pointing out.
Paolo
(*) for example I would have done:
- first job->pre_run()
- then blockdev_amend_pre_run/blockdev_amend_clean and
block_crypto_amend_pre_run/clean together