void *block_job_create(const BlockJobType *job_type, BlockDriverState *bs,

                       BlockDriverCompletionFunc *cb, void *opaque,

                       Error **errp)

{

    BlockJob *job;



    if (bs->job || bdrv_in_use(bs)) {

        error_set(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs));

        return NULL;

    }

    bdrv_set_in_use(bs, 1);



    job = g_malloc0(job_type->instance_size);

    job->job_type      = job_type;

    job->bs            = bs;

    job->cb            = cb;

    job->opaque        = opaque;

    bs->job = job;

    return job;

}

void *block_job_create(const BlockJobType *job_type, BlockDriverState *bs,

                       BlockDriverCompletionFunc *cb, void *opaque,

                       Error **errp)

{

    BlockJob *job;



    if (bs->job || bdrv_in_use(bs)) {

        error_set(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs));

        return NULL;

    }

    bdrv_set_in_use(bs, 1);



    job = g_malloc0(job_type->instance_size);

    job->job_type      = job_type;

    job->bs            = bs;

    job->cb            = cb;

    job->opaque        = opaque;

    bs->job = job;

    return job;

}

void *FUNC_0(const BlockJobType *VAR_0, BlockDriverState *VAR_1,

                       BlockDriverCompletionFunc *VAR_2, void *VAR_3,

                       Error **VAR_4)

{

    BlockJob *job;



    if (VAR_1->job || bdrv_in_use(VAR_1)) {

        error_set(VAR_4, QERR_DEVICE_IN_USE, bdrv_get_device_name(VAR_1));

        return NULL;

    }

    bdrv_set_in_use(VAR_1, 1);



    job = g_malloc0(VAR_0->instance_size);

    job->VAR_0      = VAR_0;

    job->VAR_1            = VAR_1;

    job->VAR_2            = VAR_2;

    job->VAR_3        = VAR_3;

    VAR_1->job = job;

    return job;

}

void *FUNC_0(const BlockJobType *VAR_0, BlockDriverState *VAR_1,
BlockDriverCompletionFunc *VAR_2, void *VAR_3,
Error **VAR_4)
{ BlockJob *job; if (VAR_1->job || bdrv_in_use(VAR_1)) { error_set(VAR_4, QERR_DEVICE_IN_USE, bdrv_get_device_name(VAR_1)); return NULL; } bdrv_set_in_use(VAR_1, 1); job = g_malloc0(VAR_0->instance_size); job->VAR_0      = VAR_0; job->VAR_1            = VAR_1; job->VAR_2            = VAR_2; job->VAR_3        = VAR_3; VAR_1->job = job; return job; }