static int qemu_rdma_alloc_qp(RDMAContext *rdma)

{

    struct ibv_qp_init_attr attr = { 0 };

    int ret;



    attr.cap.max_send_wr = RDMA_SIGNALED_SEND_MAX;

    attr.cap.max_recv_wr = 3;

    attr.cap.max_send_sge = 1;

    attr.cap.max_recv_sge = 1;

    attr.send_cq = rdma->cq;

    attr.recv_cq = rdma->cq;

    attr.qp_type = IBV_QPT_RC;



    ret = rdma_create_qp(rdma->cm_id, rdma->pd, &attr);

    if (ret) {

        return -1;

    }



    rdma->qp = rdma->cm_id->qp;

    return 0;

}

static int qemu_rdma_alloc_qp(RDMAContext *rdma)

{

    struct ibv_qp_init_attr attr = { 0 };

    int ret;



    attr.cap.max_send_wr = RDMA_SIGNALED_SEND_MAX;

    attr.cap.max_recv_wr = 3;

    attr.cap.max_send_sge = 1;

    attr.cap.max_recv_sge = 1;

    attr.send_cq = rdma->cq;

    attr.recv_cq = rdma->cq;

    attr.qp_type = IBV_QPT_RC;



    ret = rdma_create_qp(rdma->cm_id, rdma->pd, &attr);

    if (ret) {

        return -1;

    }



    rdma->qp = rdma->cm_id->qp;

    return 0;

}

static int FUNC_0(RDMAContext *VAR_0)

{

    struct ibv_qp_init_attr VAR_1 = { 0 };

    int VAR_2;



    VAR_1.cap.max_send_wr = RDMA_SIGNALED_SEND_MAX;

    VAR_1.cap.max_recv_wr = 3;

    VAR_1.cap.max_send_sge = 1;

    VAR_1.cap.max_recv_sge = 1;

    VAR_1.send_cq = VAR_0->cq;

    VAR_1.recv_cq = VAR_0->cq;

    VAR_1.qp_type = IBV_QPT_RC;



    VAR_2 = rdma_create_qp(VAR_0->cm_id, VAR_0->pd, &VAR_1);

    if (VAR_2) {

        return -1;

    }



    VAR_0->qp = VAR_0->cm_id->qp;

    return 0;

}

static int FUNC_0(RDMAContext *VAR_0)
{ struct ibv_qp_init_attr VAR_1 = { 0 }; int VAR_2; VAR_1.cap.max_send_wr = RDMA_SIGNALED_SEND_MAX; VAR_1.cap.max_recv_wr = 3; VAR_1.cap.max_send_sge = 1; VAR_1.cap.max_recv_sge = 1; VAR_1.send_cq = VAR_0->cq; VAR_1.recv_cq = VAR_0->cq; VAR_1.qp_type = IBV_QPT_RC; VAR_2 = rdma_create_qp(VAR_0->cm_id, VAR_0->pd, &VAR_1); if (VAR_2) { return -1; } VAR_0->qp = VAR_0->cm_id->qp; return 0; }