aboutsummaryrefslogtreecommitdiff
path: root/block/create.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/create.c')
-rw-r--r--block/create.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/block/create.c b/block/create.c
index 26a385c6c7..95341219ef 100644
--- a/block/create.c
+++ b/block/create.c
@@ -34,28 +34,20 @@ typedef struct BlockdevCreateJob {
Job common;
BlockDriver *drv;
BlockdevCreateOptions *opts;
- int ret;
} BlockdevCreateJob;
-static void blockdev_create_complete(Job *job, void *opaque)
-{
- BlockdevCreateJob *s = container_of(job, BlockdevCreateJob, common);
-
- job_completed(job, s->ret);
-}
-
static int coroutine_fn blockdev_create_run(Job *job, Error **errp)
{
BlockdevCreateJob *s = container_of(job, BlockdevCreateJob, common);
+ int ret;
job_progress_set_remaining(&s->common, 1);
- s->ret = s->drv->bdrv_co_create(s->opts, errp);
+ ret = s->drv->bdrv_co_create(s->opts, errp);
job_progress_update(&s->common, 1);
qapi_free_BlockdevCreateOptions(s->opts);
- job_defer_to_main_loop(&s->common, blockdev_create_complete, NULL);
- return s->ret;
+ return ret;
}
static const JobDriver blockdev_create_job_driver = {