static void flush_compressed_data(QEMUFile *f)

{

    int idx, len, thread_count;



    if (!migrate_use_compression()) {

        return;

    }

    thread_count = migrate_compress_threads();

    for (idx = 0; idx < thread_count; idx++) {

        if (!comp_param[idx].done) {

            qemu_mutex_lock(comp_done_lock);

            while (!comp_param[idx].done && !quit_comp_thread) {

                qemu_cond_wait(comp_done_cond, comp_done_lock);

            }

            qemu_mutex_unlock(comp_done_lock);

        }

        if (!quit_comp_thread) {

            len = qemu_put_qemu_file(f, comp_param[idx].file);

            bytes_transferred += len;

        }

    }

}

static void flush_compressed_data(QEMUFile *f)

{

    int idx, len, thread_count;



    if (!migrate_use_compression()) {

        return;

    }

    thread_count = migrate_compress_threads();

    for (idx = 0; idx < thread_count; idx++) {

        if (!comp_param[idx].done) {

            qemu_mutex_lock(comp_done_lock);

            while (!comp_param[idx].done && !quit_comp_thread) {

                qemu_cond_wait(comp_done_cond, comp_done_lock);

            }

            qemu_mutex_unlock(comp_done_lock);

        }

        if (!quit_comp_thread) {

            len = qemu_put_qemu_file(f, comp_param[idx].file);

            bytes_transferred += len;

        }

    }

}

static void FUNC_0(QEMUFile *VAR_0)

{

    int VAR_1, VAR_2, VAR_3;



    if (!migrate_use_compression()) {

        return;

    }

    VAR_3 = migrate_compress_threads();

    for (VAR_1 = 0; VAR_1 < VAR_3; VAR_1++) {

        if (!comp_param[VAR_1].done) {

            qemu_mutex_lock(comp_done_lock);

            while (!comp_param[VAR_1].done && !quit_comp_thread) {

                qemu_cond_wait(comp_done_cond, comp_done_lock);

            }

            qemu_mutex_unlock(comp_done_lock);

        }

        if (!quit_comp_thread) {

            VAR_2 = qemu_put_qemu_file(VAR_0, comp_param[VAR_1].file);

            bytes_transferred += VAR_2;

        }

    }

}

static void FUNC_0(QEMUFile *VAR_0)
{ int VAR_1, VAR_2, VAR_3; if (!migrate_use_compression()) { return; } VAR_3 = migrate_compress_threads(); for (VAR_1 = 0; VAR_1 < VAR_3; VAR_1++) { if (!comp_param[VAR_1].done) { qemu_mutex_lock(comp_done_lock); while (!comp_param[VAR_1].done && !quit_comp_thread) { qemu_cond_wait(comp_done_cond, comp_done_lock); } qemu_mutex_unlock(comp_done_lock); } if (!quit_comp_thread) { VAR_2 = qemu_put_qemu_file(VAR_0, comp_param[VAR_1].file); bytes_transferred += VAR_2; } } }