static int qemu_rdma_write_flush(QEMUFile *f, RDMAContext *rdma)

{

    int ret;



    if (!rdma->current_length) {

        return 0;

    }



    ret = qemu_rdma_write_one(f, rdma,

            rdma->current_index, rdma->current_addr, rdma->current_length);



    if (ret < 0) {

        return ret;

    }



    if (ret == 0) {

        rdma->nb_sent++;

        DDDPRINTF("sent total: %d\n", rdma->nb_sent);

    }



    rdma->current_length = 0;

    rdma->current_addr = 0;



    return 0;

}

static int qemu_rdma_write_flush(QEMUFile *f, RDMAContext *rdma)

{

    int ret;



    if (!rdma->current_length) {

        return 0;

    }



    ret = qemu_rdma_write_one(f, rdma,

            rdma->current_index, rdma->current_addr, rdma->current_length);



    if (ret < 0) {

        return ret;

    }



    if (ret == 0) {

        rdma->nb_sent++;

        DDDPRINTF("sent total: %d\n", rdma->nb_sent);

    }



    rdma->current_length = 0;

    rdma->current_addr = 0;



    return 0;

}

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

{

    int VAR_2;



    if (!VAR_1->current_length) {

        return 0;

    }



    VAR_2 = qemu_rdma_write_one(VAR_0, VAR_1,

            VAR_1->current_index, VAR_1->current_addr, VAR_1->current_length);



    if (VAR_2 < 0) {

        return VAR_2;

    }



    if (VAR_2 == 0) {

        VAR_1->nb_sent++;

        DDDPRINTF("sent total: %d\n", VAR_1->nb_sent);

    }



    VAR_1->current_length = 0;

    VAR_1->current_addr = 0;



    return 0;

}

static int FUNC_0(QEMUFile *VAR_0, RDMAContext *VAR_1)
{ int VAR_2; if (!VAR_1->current_length) { return 0; } VAR_2 = qemu_rdma_write_one(VAR_0, VAR_1,
VAR_1->current_index, VAR_1->current_addr, VAR_1->current_length); if (VAR_2 < 0) { return VAR_2; } if (VAR_2 == 0) { VAR_1->nb_sent++; DDDPRINTF("sent total: %d\n", VAR_1->nb_sent); } VAR_1->current_length = 0; VAR_1->current_addr = 0; return 0; }