void qmp_block_dirty_bitmap_clear(const char *node, const char *name,

                                  Error **errp)

{

    AioContext *aio_context;

    BdrvDirtyBitmap *bitmap;

    BlockDriverState *bs;



    bitmap = block_dirty_bitmap_lookup(node, name, &bs, &aio_context, errp);

    if (!bitmap || !bs) {

        return;

    }



    if (bdrv_dirty_bitmap_frozen(bitmap)) {

        error_setg(errp,

                   "Bitmap '%s' is currently frozen and cannot be modified",

                   name);

        goto out;

    } else if (!bdrv_dirty_bitmap_enabled(bitmap)) {

        error_setg(errp,

                   "Bitmap '%s' is currently disabled and cannot be cleared",

                   name);

        goto out;

    }



    bdrv_clear_dirty_bitmap(bitmap, NULL);



 out:

    aio_context_release(aio_context);

}

void qmp_block_dirty_bitmap_clear(const char *node, const char *name,

                                  Error **errp)

{

    AioContext *aio_context;

    BdrvDirtyBitmap *bitmap;

    BlockDriverState *bs;



    bitmap = block_dirty_bitmap_lookup(node, name, &bs, &aio_context, errp);

    if (!bitmap || !bs) {

        return;

    }



    if (bdrv_dirty_bitmap_frozen(bitmap)) {

        error_setg(errp,

                   "Bitmap '%s' is currently frozen and cannot be modified",

                   name);

        goto out;

    } else if (!bdrv_dirty_bitmap_enabled(bitmap)) {

        error_setg(errp,

                   "Bitmap '%s' is currently disabled and cannot be cleared",

                   name);

        goto out;

    }



    bdrv_clear_dirty_bitmap(bitmap, NULL);



 out:

    aio_context_release(aio_context);

}

void FUNC_0(const char *VAR_0, const char *VAR_1,

                                  Error **VAR_2)

{

    AioContext *aio_context;

    BdrvDirtyBitmap *bitmap;

    BlockDriverState *bs;



    bitmap = block_dirty_bitmap_lookup(VAR_0, VAR_1, &bs, &aio_context, VAR_2);

    if (!bitmap || !bs) {

        return;

    }



    if (bdrv_dirty_bitmap_frozen(bitmap)) {

        error_setg(VAR_2,

                   "Bitmap '%s' is currently frozen and cannot be modified",

                   VAR_1);

        goto out;

    } else if (!bdrv_dirty_bitmap_enabled(bitmap)) {

        error_setg(VAR_2,

                   "Bitmap '%s' is currently disabled and cannot be cleared",

                   VAR_1);

        goto out;

    }



    bdrv_clear_dirty_bitmap(bitmap, NULL);



 out:

    aio_context_release(aio_context);

}

void FUNC_0(const char *VAR_0, const char *VAR_1,
Error **VAR_2)
{ AioContext *aio_context; BdrvDirtyBitmap *bitmap; BlockDriverState *bs; bitmap = block_dirty_bitmap_lookup(VAR_0, VAR_1, &bs, &aio_context, VAR_2); if (!bitmap || !bs) { return; } if (bdrv_dirty_bitmap_frozen(bitmap)) { error_setg(VAR_2,
"Bitmap '%s' is currently frozen and cannot be modified",
VAR_1); goto out; } else if (!bdrv_dirty_bitmap_enabled(bitmap)) { error_setg(VAR_2,
"Bitmap '%s' is currently disabled and cannot be cleared",
VAR_1); goto out; } bdrv_clear_dirty_bitmap(bitmap, NULL); out:
aio_context_release(aio_context); }