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

{

    rcu_read_lock();



    migration_bitmap_sync();



    ram_control_before_iterate(f, RAM_CONTROL_FINISH);



    /* try transferring iterative blocks of memory */



    /* flush all remaining blocks regardless of rate limiting */

    while (true) {

        int pages;



        pages = ram_find_and_save_block(f, true, &bytes_transferred);

        /* no more blocks to sent */

        if (pages == 0) {

            break;

        }

    }



    flush_compressed_data(f);

    ram_control_after_iterate(f, RAM_CONTROL_FINISH);

    migration_end();



    rcu_read_unlock();

    qemu_put_be64(f, RAM_SAVE_FLAG_EOS);



    return 0;

}

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

{

    rcu_read_lock();



    migration_bitmap_sync();



    ram_control_before_iterate(f, RAM_CONTROL_FINISH);



    



    

    while (true) {

        int pages;



        pages = ram_find_and_save_block(f, true, &bytes_transferred);

        

        if (pages == 0) {

            break;

        }

    }



    flush_compressed_data(f);

    ram_control_after_iterate(f, RAM_CONTROL_FINISH);

    migration_end();



    rcu_read_unlock();

    qemu_put_be64(f, RAM_SAVE_FLAG_EOS);



    return 0;

}

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

{

    rcu_read_lock();



    migration_bitmap_sync();



    ram_control_before_iterate(VAR_0, RAM_CONTROL_FINISH);



    



    

    while (true) {

        int VAR_2;



        VAR_2 = ram_find_and_save_block(VAR_0, true, &bytes_transferred);

        

        if (VAR_2 == 0) {

            break;

        }

    }



    flush_compressed_data(VAR_0);

    ram_control_after_iterate(VAR_0, RAM_CONTROL_FINISH);

    migration_end();



    rcu_read_unlock();

    qemu_put_be64(VAR_0, RAM_SAVE_FLAG_EOS);



    return 0;

}

static int FUNC_0(QEMUFile *VAR_0, void *VAR_1)
{ rcu_read_lock(); migration_bitmap_sync(); ram_control_before_iterate(VAR_0, RAM_CONTROL_FINISH); while (true) { int VAR_2; VAR_2 = ram_find_and_save_block(VAR_0, true, &bytes_transferred); if (VAR_2 == 0) { break; } } flush_compressed_data(VAR_0); ram_control_after_iterate(VAR_0, RAM_CONTROL_FINISH); migration_end(); rcu_read_unlock(); qemu_put_be64(VAR_0, RAM_SAVE_FLAG_EOS); return 0; }