static int block_save_complete(QEMUFile *f, void *opaque)

{

    int ret;



    DPRINTF("Enter save live complete submitted %d transferred %d\n",

            block_mig_state.submitted, block_mig_state.transferred);



    ret = flush_blks(f);

    if (ret) {

        blk_mig_cleanup();

        return ret;

    }



    blk_mig_reset_dirty_cursor();



    /* we know for sure that save bulk is completed and

       all async read completed */

    assert(block_mig_state.submitted == 0);



    do {

        ret = blk_mig_save_dirty_block(f, 0);

    } while (ret == 0);



    blk_mig_cleanup();

    if (ret) {

        return ret;

    }

    /* report completion */

    qemu_put_be64(f, (100 << BDRV_SECTOR_BITS) | BLK_MIG_FLAG_PROGRESS);



    DPRINTF("Block migration completed\n");



    qemu_put_be64(f, BLK_MIG_FLAG_EOS);



    return 0;

}

static int block_save_complete(QEMUFile *f, void *opaque)

{

    int ret;



    DPRINTF("Enter save live complete submitted %d transferred %d\n",

            block_mig_state.submitted, block_mig_state.transferred);



    ret = flush_blks(f);

    if (ret) {

        blk_mig_cleanup();

        return ret;

    }



    blk_mig_reset_dirty_cursor();



    



    assert(block_mig_state.submitted == 0);



    do {

        ret = blk_mig_save_dirty_block(f, 0);

    } while (ret == 0);



    blk_mig_cleanup();

    if (ret) {

        return ret;

    }

    

    qemu_put_be64(f, (100 << BDRV_SECTOR_BITS) | BLK_MIG_FLAG_PROGRESS);



    DPRINTF("Block migration completed\n");



    qemu_put_be64(f, BLK_MIG_FLAG_EOS);



    return 0;

}

static int FUNC_0(QEMUFile *VAR_0, void *VAR_1)

{

    int VAR_2;



    DPRINTF("Enter save live complete submitted %d transferred %d\n",

            block_mig_state.submitted, block_mig_state.transferred);



    VAR_2 = flush_blks(VAR_0);

    if (VAR_2) {

        blk_mig_cleanup();

        return VAR_2;

    }



    blk_mig_reset_dirty_cursor();



    



    assert(block_mig_state.submitted == 0);



    do {

        VAR_2 = blk_mig_save_dirty_block(VAR_0, 0);

    } while (VAR_2 == 0);



    blk_mig_cleanup();

    if (VAR_2) {

        return VAR_2;

    }

    

    qemu_put_be64(VAR_0, (100 << BDRV_SECTOR_BITS) | BLK_MIG_FLAG_PROGRESS);



    DPRINTF("Block migration completed\n");



    qemu_put_be64(VAR_0, BLK_MIG_FLAG_EOS);



    return 0;

}

static int FUNC_0(QEMUFile *VAR_0, void *VAR_1)
{ int VAR_2; DPRINTF("Enter save live complete submitted %d transferred %d\n",
block_mig_state.submitted, block_mig_state.transferred); VAR_2 = flush_blks(VAR_0); if (VAR_2) { blk_mig_cleanup(); return VAR_2; } blk_mig_reset_dirty_cursor(); assert(block_mig_state.submitted == 0); do { VAR_2 = blk_mig_save_dirty_block(VAR_0, 0); } while (VAR_2 == 0); blk_mig_cleanup(); if (VAR_2) { return VAR_2; } qemu_put_be64(VAR_0, (100 << BDRV_SECTOR_BITS) | BLK_MIG_FLAG_PROGRESS); DPRINTF("Block migration completed\n"); qemu_put_be64(VAR_0, BLK_MIG_FLAG_EOS); return 0; }