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

{

    int ret;



    if (qemu_rdma_write_flush(f, rdma) < 0) {

        return -EIO;

    }



    while (rdma->nb_sent) {

        ret = qemu_rdma_block_for_wrid(rdma, RDMA_WRID_RDMA_WRITE, NULL);

        if (ret < 0) {

            fprintf(stderr, "rdma migration: complete polling error!\n");

            return -EIO;

        }

    }



    qemu_rdma_unregister_waiting(rdma);



    return 0;

}

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

{

    int ret;



    if (qemu_rdma_write_flush(f, rdma) < 0) {

        return -EIO;

    }



    while (rdma->nb_sent) {

        ret = qemu_rdma_block_for_wrid(rdma, RDMA_WRID_RDMA_WRITE, NULL);

        if (ret < 0) {

            fprintf(stderr, "rdma migration: complete polling error!\n");

            return -EIO;

        }

    }



    qemu_rdma_unregister_waiting(rdma);



    return 0;

}

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

{

    int VAR_2;



    if (qemu_rdma_write_flush(VAR_0, VAR_1) < 0) {

        return -EIO;

    }



    while (VAR_1->nb_sent) {

        VAR_2 = qemu_rdma_block_for_wrid(VAR_1, RDMA_WRID_RDMA_WRITE, NULL);

        if (VAR_2 < 0) {

            fprintf(stderr, "VAR_1 migration: complete polling error!\n");

            return -EIO;

        }

    }



    qemu_rdma_unregister_waiting(VAR_1);



    return 0;

}

static int FUNC_0(QEMUFile *VAR_0, RDMAContext *VAR_1)
{ int VAR_2; if (qemu_rdma_write_flush(VAR_0, VAR_1) < 0) { return -EIO; } while (VAR_1->nb_sent) { VAR_2 = qemu_rdma_block_for_wrid(VAR_1, RDMA_WRID_RDMA_WRITE, NULL); if (VAR_2 < 0) { fprintf(stderr, "VAR_1 migration: complete polling error!\n"); return -EIO; } } qemu_rdma_unregister_waiting(VAR_1); return 0; }