void qmp_block_job_cancel(const char *device,

                          bool has_force, bool force, Error **errp)

{

    BlockJob *job = find_block_job(device);



    if (!has_force) {

        force = false;

    }



    if (!job) {

        error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);

        return;

    }

    if (job->paused && !force) {

        error_setg(errp, "The block job for device '%s' is currently paused",

                   device);

        return;

    }



    trace_qmp_block_job_cancel(job);

    block_job_cancel(job);

}

void qmp_block_job_cancel(const char *device,

                          bool has_force, bool force, Error **errp)

{

    BlockJob *job = find_block_job(device);



    if (!has_force) {

        force = false;

    }



    if (!job) {

        error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);

        return;

    }

    if (job->paused && !force) {

        error_setg(errp, "The block job for device '%s' is currently paused",

                   device);

        return;

    }



    trace_qmp_block_job_cancel(job);

    block_job_cancel(job);

}

void FUNC_0(const char *VAR_0,

                          bool VAR_1, bool VAR_2, Error **VAR_3)

{

    BlockJob *job = find_block_job(VAR_0);



    if (!VAR_1) {

        VAR_2 = false;

    }



    if (!job) {

        error_set(VAR_3, QERR_BLOCK_JOB_NOT_ACTIVE, VAR_0);

        return;

    }

    if (job->paused && !VAR_2) {

        error_setg(VAR_3, "The block job for VAR_0 '%s' is currently paused",

                   VAR_0);

        return;

    }



    trace_qmp_block_job_cancel(job);

    block_job_cancel(job);

}

void FUNC_0(const char *VAR_0,
bool VAR_1, bool VAR_2, Error **VAR_3)
{ BlockJob *job = find_block_job(VAR_0); if (!VAR_1) { VAR_2 = false; } if (!job) { error_set(VAR_3, QERR_BLOCK_JOB_NOT_ACTIVE, VAR_0); return; } if (job->paused && !VAR_2) { error_setg(VAR_3, "The block job for VAR_0 '%s' is currently paused",
VAR_0); return; } trace_qmp_block_job_cancel(job); block_job_cancel(job); }