From 2cfa95300908f401f5b9bdf3de734cf6228a2722 Mon Sep 17 00:00:00 2001 From: Yuval Shaia Date: Mon, 11 Mar 2019 03:29:07 -0700 Subject: hw/rdma: Protect against concurrent execution of poll_cq The function rdma_poll_cq is called from two contexts - completion handler thread which sense new completion on backend channel and explicitly as result of guest issuing poll_cq command. Add lock to protect against concurrent executions. Signed-off-by: Yuval Shaia Reviewed-by: Marcel Apfelbaum Message-Id: <1552300155-25216-4-git-send-email-yuval.shaia@oracle.com> Reviewed-by: Kamal Heib Signed-off-by: Marcel Apfelbaum --- hw/rdma/rdma_rm_defs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/rdma/rdma_rm_defs.h') diff --git a/hw/rdma/rdma_rm_defs.h b/hw/rdma/rdma_rm_defs.h index 0ba61d1838..f0ee1f3072 100644 --- a/hw/rdma/rdma_rm_defs.h +++ b/hw/rdma/rdma_rm_defs.h @@ -105,6 +105,7 @@ typedef struct RdmaDeviceResources { RdmaRmResTbl cq_tbl; RdmaRmResTbl cqe_ctx_tbl; GHashTable *qp_hash; /* Keeps mapping between real and emulated */ + QemuMutex lock; } RdmaDeviceResources; #endif -- cgit v1.2.3