static void mirror_start_job(BlockDriverState *bs, BlockDriverState *target,

                             const char *replaces,

                             int64_t speed, uint32_t granularity,

                             int64_t buf_size,

                             BlockMirrorBackingMode backing_mode,

                             BlockdevOnError on_source_error,

                             BlockdevOnError on_target_error,

                             bool unmap,

                             BlockCompletionFunc *cb,

                             void *opaque, Error **errp,

                             const BlockJobDriver *driver,

                             bool is_none_mode, BlockDriverState *base)

{

    MirrorBlockJob *s;



    if (granularity == 0) {

        granularity = bdrv_get_default_bitmap_granularity(target);

    }



    assert ((granularity & (granularity - 1)) == 0);



    if (buf_size < 0) {

        error_setg(errp, "Invalid parameter 'buf-size'");

        return;

    }



    if (buf_size == 0) {

        buf_size = DEFAULT_MIRROR_BUF_SIZE;

    }



    s = block_job_create(driver, bs, speed, cb, opaque, errp);

    if (!s) {

        return;

    }



    s->target = blk_new();

    blk_insert_bs(s->target, target);



    s->replaces = g_strdup(replaces);

    s->on_source_error = on_source_error;

    s->on_target_error = on_target_error;

    s->is_none_mode = is_none_mode;

    s->backing_mode = backing_mode;

    s->base = base;

    s->granularity = granularity;

    s->buf_size = ROUND_UP(buf_size, granularity);

    s->unmap = unmap;



    s->dirty_bitmap = bdrv_create_dirty_bitmap(bs, granularity, NULL, errp);

    if (!s->dirty_bitmap) {

        g_free(s->replaces);

        blk_unref(s->target);

        block_job_unref(&s->common);

        return;

    }



    bdrv_op_block_all(target, s->common.blocker);



    s->common.co = qemu_coroutine_create(mirror_run);

    trace_mirror_start(bs, s, s->common.co, opaque);

    qemu_coroutine_enter(s->common.co, s);

}

static void mirror_start_job(BlockDriverState *bs, BlockDriverState *target,

                             const char *replaces,

                             int64_t speed, uint32_t granularity,

                             int64_t buf_size,

                             BlockMirrorBackingMode backing_mode,

                             BlockdevOnError on_source_error,

                             BlockdevOnError on_target_error,

                             bool unmap,

                             BlockCompletionFunc *cb,

                             void *opaque, Error **errp,

                             const BlockJobDriver *driver,

                             bool is_none_mode, BlockDriverState *base)

{

    MirrorBlockJob *s;



    if (granularity == 0) {

        granularity = bdrv_get_default_bitmap_granularity(target);

    }



    assert ((granularity & (granularity - 1)) == 0);



    if (buf_size < 0) {

        error_setg(errp, "Invalid parameter 'buf-size'");

        return;

    }



    if (buf_size == 0) {

        buf_size = DEFAULT_MIRROR_BUF_SIZE;

    }



    s = block_job_create(driver, bs, speed, cb, opaque, errp);

    if (!s) {

        return;

    }



    s->target = blk_new();

    blk_insert_bs(s->target, target);



    s->replaces = g_strdup(replaces);

    s->on_source_error = on_source_error;

    s->on_target_error = on_target_error;

    s->is_none_mode = is_none_mode;

    s->backing_mode = backing_mode;

    s->base = base;

    s->granularity = granularity;

    s->buf_size = ROUND_UP(buf_size, granularity);

    s->unmap = unmap;



    s->dirty_bitmap = bdrv_create_dirty_bitmap(bs, granularity, NULL, errp);

    if (!s->dirty_bitmap) {

        g_free(s->replaces);

        blk_unref(s->target);

        block_job_unref(&s->common);

        return;

    }



    bdrv_op_block_all(target, s->common.blocker);



    s->common.co = qemu_coroutine_create(mirror_run);

    trace_mirror_start(bs, s, s->common.co, opaque);

    qemu_coroutine_enter(s->common.co, s);

}

    s = block_job_create(driver, bs, speed, cb, opaque, errp);
static void FUNC_0(BlockDriverState *VAR_0, BlockDriverState *VAR_1,

                             const char *VAR_2,

                             int64_t VAR_3, uint32_t VAR_4,

                             int64_t VAR_5,

                             BlockMirrorBackingMode VAR_6,

                             BlockdevOnError VAR_7,

                             BlockdevOnError VAR_8,

                             bool VAR_9,

                             BlockCompletionFunc *VAR_10,

                             void *VAR_11, Error **VAR_12,

                             const BlockJobDriver *VAR_13,

                             bool VAR_14, BlockDriverState *VAR_15)

{

    MirrorBlockJob *s;



    if (VAR_4 == 0) {

        VAR_4 = bdrv_get_default_bitmap_granularity(VAR_1);

    }



    assert ((VAR_4 & (VAR_4 - 1)) == 0);



    if (VAR_5 < 0) {

        error_setg(VAR_12, "Invalid parameter 'buf-size'");

        return;

    }



    if (VAR_5 == 0) {

        VAR_5 = DEFAULT_MIRROR_BUF_SIZE;

    }



    s = block_job_create(VAR_13, VAR_0, VAR_3, VAR_10, VAR_11, VAR_12);

    if (!s) {

        return;

    }



    s->VAR_1 = blk_new();

    blk_insert_bs(s->VAR_1, VAR_1);



    s->VAR_2 = g_strdup(VAR_2);

    s->VAR_7 = VAR_7;

    s->VAR_8 = VAR_8;

    s->VAR_14 = VAR_14;

    s->VAR_6 = VAR_6;

    s->VAR_15 = VAR_15;

    s->VAR_4 = VAR_4;

    s->VAR_5 = ROUND_UP(VAR_5, VAR_4);

    s->VAR_9 = VAR_9;



    s->dirty_bitmap = bdrv_create_dirty_bitmap(VAR_0, VAR_4, NULL, VAR_12);

    if (!s->dirty_bitmap) {

        g_free(s->VAR_2);

        blk_unref(s->VAR_1);

        block_job_unref(&s->common);

        return;

    }



    bdrv_op_block_all(VAR_1, s->common.blocker);



    s->common.co = qemu_coroutine_create(mirror_run);

    trace_mirror_start(VAR_0, s, s->common.co, VAR_11);

    qemu_coroutine_enter(s->common.co, s);

}

static void FUNC_0(BlockDriverState *VAR_0, BlockDriverState *VAR_1,
const char *VAR_2,
int64_t VAR_3, uint32_t VAR_4,
int64_t VAR_5,
BlockMirrorBackingMode VAR_6,
BlockdevOnError VAR_7,
BlockdevOnError VAR_8,
bool VAR_9,
BlockCompletionFunc *VAR_10,
void *VAR_11, Error **VAR_12,
const BlockJobDriver *VAR_13,
bool VAR_14, BlockDriverState *VAR_15)
{ MirrorBlockJob *s; if (VAR_4 == 0) { VAR_4 = bdrv_get_default_bitmap_granularity(VAR_1); } assert ((VAR_4 & (VAR_4 - 1)) == 0); if (VAR_5 < 0) { error_setg(VAR_12, "Invalid parameter 'buf-size'"); return; } if (VAR_5 == 0) { VAR_5 = DEFAULT_MIRROR_BUF_SIZE; } s = block_job_create(VAR_13, VAR_0, VAR_3, VAR_10, VAR_11, VAR_12); if (!s) { return; } s->VAR_1 = blk_new(); blk_insert_bs(s->VAR_1, VAR_1); s->VAR_2 = g_strdup(VAR_2); s->VAR_7 = VAR_7; s->VAR_8 = VAR_8; s->VAR_14 = VAR_14; s->VAR_6 = VAR_6; s->VAR_15 = VAR_15; s->VAR_4 = VAR_4; s->VAR_5 = ROUND_UP(VAR_5, VAR_4); s->VAR_9 = VAR_9; s->dirty_bitmap = bdrv_create_dirty_bitmap(VAR_0, VAR_4, NULL, VAR_12); if (!s->dirty_bitmap) { g_free(s->VAR_2); blk_unref(s->VAR_1); block_job_unref(&s->common); return; } bdrv_op_block_all(VAR_1, s->common.blocker); s->common.co = qemu_coroutine_create(mirror_run); trace_mirror_start(VAR_0, s, s->common.co, VAR_11); qemu_coroutine_enter(s->common.co, s); }