diff options
author | Yuval Shaia <yuval.shaia@oracle.com> | 2018-08-05 18:35:15 +0300 |
---|---|---|
committer | Marcel Apfelbaum <marcel.apfelbaum@gmail.com> | 2018-08-18 18:00:39 +0300 |
commit | 292dce627b51329212130470f485b7dc2b72b48c (patch) | |
tree | 22a87dac88dd3abed4deb14c87dfaa3921215017 | |
parent | 67b32fe250a0a9759e4ead14bdcc1d992dd9bf44 (diff) | |
download | qemu-292dce627b51329212130470f485b7dc2b72b48c.zip qemu-292dce627b51329212130470f485b7dc2b72b48c.tar.gz qemu-292dce627b51329212130470f485b7dc2b72b48c.tar.bz2 |
hw/rdma: Cosmetic change - move to generic function
To ease maintenance of struct comp_thread move all related code to
dedicated function.
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <20180805153518.2983-11-yuval.shaia@oracle.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
-rw-r--r-- | hw/rdma/rdma_backend.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index 52981d6..d29acc5 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -146,10 +146,10 @@ static void *comp_handler_thread(void *arg) return NULL; } -static void stop_comp_thread(RdmaBackendDev *backend_dev) +static void stop_backend_thread(RdmaBackendThread *thread) { - backend_dev->comp_thread.run = false; - while (backend_dev->comp_thread.is_running) { + thread->run = false; + while (thread->is_running) { pr_dbg("Waiting for thread to complete\n"); sleep(THR_POLL_TO / SCALE_US / 2); } @@ -159,7 +159,7 @@ static void start_comp_thread(RdmaBackendDev *backend_dev) { char thread_name[THR_NAME_LEN] = {0}; - stop_comp_thread(backend_dev); + stop_backend_thread(&backend_dev->comp_thread); snprintf(thread_name, sizeof(thread_name), "rdma_comp_%s", ibv_get_device_name(backend_dev->ib_dev)); @@ -876,7 +876,7 @@ void rdma_backend_start(RdmaBackendDev *backend_dev) void rdma_backend_stop(RdmaBackendDev *backend_dev) { pr_dbg("Stopping rdma_backend\n"); - stop_comp_thread(backend_dev); + stop_backend_thread(&backend_dev->comp_thread); } void rdma_backend_fini(RdmaBackendDev *backend_dev) |