static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,

                              int64_t pos)

{

    BDRVQcowState *s = bs->opaque;

    int64_t total_sectors = bs->total_sectors;

    int growable = bs->growable;


    int ret;



    BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);

    bs->growable = 1;


    ret = bdrv_pwritev(bs, qcow2_vm_state_offset(s) + pos, qiov);

    bs->growable = growable;




    /* bdrv_co_do_writev will have increased the total_sectors value to include

     * the VM state - the VM state is however not an actual part of the block

     * device, therefore, we need to restore the old value. */

    bs->total_sectors = total_sectors;



    return ret;

}
static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,

                              int64_t pos)

{

    BDRVQcowState *s = bs->opaque;

    int64_t total_sectors = bs->total_sectors;

    int growable = bs->growable;


    int ret;



    BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);

    bs->growable = 1;


    ret = bdrv_pwritev(bs, qcow2_vm_state_offset(s) + pos, qiov);

    bs->growable = growable;




    





    bs->total_sectors = total_sectors;



    return ret;

}
static int FUNC_0(BlockDriverState *VAR_0, QEMUIOVector *VAR_1,

                              int64_t VAR_2)

{

    BDRVQcowState *s = VAR_0->opaque;

    int64_t total_sectors = VAR_0->total_sectors;

    int VAR_3 = VAR_0->VAR_3;


    int VAR_4;



    BLKDBG_EVENT(VAR_0->file, BLKDBG_VMSTATE_SAVE);

    VAR_0->VAR_3 = 1;


    VAR_4 = bdrv_pwritev(VAR_0, qcow2_vm_state_offset(s) + VAR_2, VAR_1);

    VAR_0->VAR_3 = VAR_3;




    





    VAR_0->total_sectors = total_sectors;



    return VAR_4;

}
static int FUNC_0(BlockDriverState *VAR_0, QEMUIOVector *VAR_1,
int64_t VAR_2)
{ BDRVQcowState *s = VAR_0->opaque; int64_t total_sectors = VAR_0->total_sectors; int VAR_3 = VAR_0->VAR_3; int VAR_4; BLKDBG_EVENT(VAR_0->file, BLKDBG_VMSTATE_SAVE); VAR_0->VAR_3 = 1; VAR_4 = bdrv_pwritev(VAR_0, qcow2_vm_state_offset(s) + VAR_2, VAR_1); VAR_0->VAR_3 = VAR_3; VAR_0->total_sectors = total_sectors; return VAR_4; }