--- /dev/null
+Bottom: 3031200314ac92ae8dca630fbebad05131047596
+Top: 2974580c2cba361aa431ca4bf7b4b530a731d044
+Author: Sean Hefty <sean.hefty@intel.com>
+Date: 2012-09-26 12:18:20 -0700
+
+Refresh of xrc_qp
+
+---
+
+diff --git a/include/infiniband/driver.h b/include/infiniband/driver.h
+index f15457c..6afd93b 100644
+--- a/include/infiniband/driver.h
++++ b/include/infiniband/driver.h
+@@ -160,7 +160,7 @@ int ibv_cmd_create_qp(struct ibv_pd *pd,
+ struct ibv_qp *qp, struct ibv_qp_init_attr *attr,
+ struct ibv_create_qp *cmd, size_t cmd_size,
+ struct ibv_create_qp_resp *resp, size_t resp_size);
+-int ibv_cmd_create_qp_ex(struct ibv_context *context,
++int ibv_cmd_create_qp_ex(struct verbs_context *context,
+ struct verbs_qp *qp, struct ibv_qp_init_attr_ex *attr_ex,
+ struct ibv_create_qp *cmd, size_t cmd_size,
+ struct ibv_create_qp_resp *resp, size_t resp_size);
+diff --git a/src/cmd.c b/src/cmd.c
+index 47426ab..70abfe8 100644
+--- a/src/cmd.c
++++ b/src/cmd.c
+@@ -653,12 +653,11 @@ int ibv_cmd_destroy_srq(struct ibv_srq *srq)
+ return 0;
+ }
+
+-int ibv_cmd_create_qp_ex(struct ibv_context *context,
++int ibv_cmd_create_qp_ex(struct verbs_context *context,
+ struct verbs_qp *qp, struct ibv_qp_init_attr_ex *attr_ex,
+ struct ibv_create_qp *cmd, size_t cmd_size,
+ struct ibv_create_qp_resp *resp, size_t resp_size)
+ {
+- struct ibv_context *context;
+ struct verbs_xrcd *vxrcd = NULL;
+
+ IBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_QP, resp, resp_size);
+@@ -667,11 +666,9 @@ int ibv_cmd_create_qp_ex(struct ibv_context *context,
+
+ if (attr_ex->comp_mask & IBV_QP_INIT_ATTR_XRCD) {
+ vxrcd = container_of(attr_ex->xrcd, struct verbs_xrcd, xrcd);
+- context = vxrcd->xrcd.context;
+ cmd->pd_handle = vxrcd->handle;
+ } else {
+- context = pd->context;
+- cmd->pd_handle = pd->handle;
++ cmd->pd_handle = attr_ex->pd->handle;
+ cmd->send_cq_handle = attr_ex->send_cq->handle;
+
+ if (attr_ex->qp_type != IBV_QPT_XRC_SEND) {
+@@ -690,7 +687,7 @@ int ibv_cmd_create_qp_ex(struct ibv_context *context,
+ cmd->is_srq = !!attr_ex->srq;
+ cmd->reserved = 0;
+
+- if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
++ if (write(context->context.cmd_fd, cmd, cmd_size) != cmd_size)
+ return errno;
+
+ (void) VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
+@@ -721,9 +718,9 @@ int ibv_cmd_create_qp_ex(struct ibv_context *context,
+
+ qp->qp.handle = resp->qp_handle;
+ qp->qp.qp_num = resp->qpn;
+- qp->qp.context = context;
++ qp->qp.context = &context->context;
+ qp->qp.qp_context = qp_init_attr_ex->qp_context;
+- qp->qp.pd = pd;
++ qp->qp.pd = attr_ex->pd;
+ qp->qp.send_cq = qp_init_attr_ex->send_cq;
+ qp->qp.recv_cq = qp_init_attr_ex->recv_cq;
+ qp->qp.srq = qp_init_attr_ex->srq;
+@@ -752,8 +749,6 @@ int ibv_cmd_create_qp(struct ibv_pd *pd,
+ IBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_QP, resp, resp_size);
+
+ cmd->user_handle = (uintptr_t) qp;
+-
+- context = pd->context;
+ cmd->pd_handle = pd->handle;
+ cmd->send_cq_handle = attr->send_cq->handle;
+ cmd->max_send_wr = attr->cap.max_send_wr;