static void block_dirty_bitmap_clear_prepare(BlkActionState *common,

                                             Error **errp)

{

    BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,

                                             common, common);

    BlockDirtyBitmap *action;



    if (action_check_completion_mode(common, errp) < 0) {

        return;

    }



    action = common->action->u.block_dirty_bitmap_clear.data;

    state->bitmap = block_dirty_bitmap_lookup(action->node,

                                              action->name,

                                              &state->bs,

                                              &state->aio_context,

                                              errp);

    if (!state->bitmap) {

        return;

    }



    if (bdrv_dirty_bitmap_frozen(state->bitmap)) {

        error_setg(errp, "Cannot modify a frozen bitmap");

        return;

    } else if (!bdrv_dirty_bitmap_enabled(state->bitmap)) {

        error_setg(errp, "Cannot clear a disabled bitmap");

        return;

    }



    bdrv_clear_dirty_bitmap(state->bitmap, &state->backup);

    /* AioContext is released in .clean() */

}

static void block_dirty_bitmap_clear_prepare(BlkActionState *common,

                                             Error **errp)

{

    BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,

                                             common, common);

    BlockDirtyBitmap *action;



    if (action_check_completion_mode(common, errp) < 0) {

        return;

    }



    action = common->action->u.block_dirty_bitmap_clear.data;

    state->bitmap = block_dirty_bitmap_lookup(action->node,

                                              action->name,

                                              &state->bs,

                                              &state->aio_context,

                                              errp);

    if (!state->bitmap) {

        return;

    }



    if (bdrv_dirty_bitmap_frozen(state->bitmap)) {

        error_setg(errp, "Cannot modify a frozen bitmap");

        return;

    } else if (!bdrv_dirty_bitmap_enabled(state->bitmap)) {

        error_setg(errp, "Cannot clear a disabled bitmap");

        return;

    }



    bdrv_clear_dirty_bitmap(state->bitmap, &state->backup);

    

}

static void FUNC_0(BlkActionState *VAR_0,

                                             Error **VAR_1)

{

    BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,

                                             VAR_0, VAR_0);

    BlockDirtyBitmap *action;



    if (action_check_completion_mode(VAR_0, VAR_1) < 0) {

        return;

    }



    action = VAR_0->action->u.block_dirty_bitmap_clear.data;

    state->bitmap = block_dirty_bitmap_lookup(action->node,

                                              action->name,

                                              &state->bs,

                                              &state->aio_context,

                                              VAR_1);

    if (!state->bitmap) {

        return;

    }



    if (bdrv_dirty_bitmap_frozen(state->bitmap)) {

        error_setg(VAR_1, "Cannot modify a frozen bitmap");

        return;

    } else if (!bdrv_dirty_bitmap_enabled(state->bitmap)) {

        error_setg(VAR_1, "Cannot clear a disabled bitmap");

        return;

    }



    bdrv_clear_dirty_bitmap(state->bitmap, &state->backup);

    

}

static void FUNC_0(BlkActionState *VAR_0,
Error **VAR_1)
{ BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,
VAR_0, VAR_0); BlockDirtyBitmap *action; if (action_check_completion_mode(VAR_0, VAR_1) < 0) { return; } action = VAR_0->action->u.block_dirty_bitmap_clear.data; state->bitmap = block_dirty_bitmap_lookup(action->node,
action->name,
&state->bs,
&state->aio_context,
VAR_1); if (!state->bitmap) { return; } if (bdrv_dirty_bitmap_frozen(state->bitmap)) { error_setg(VAR_1, "Cannot modify a frozen bitmap"); return; } else if (!bdrv_dirty_bitmap_enabled(state->bitmap)) { error_setg(VAR_1, "Cannot clear a disabled bitmap"); return; } bdrv_clear_dirty_bitmap(state->bitmap, &state->backup); }