examples/vhost_blk: set control worker thread name
authorChengwen Feng <fengchengwen@huawei.com>
Sat, 17 Apr 2021 09:09:48 +0000 (17:09 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 21 Apr 2021 13:57:51 +0000 (15:57 +0200)
This patch supports set ctrl worker thread name which is helpful for
debugging.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
examples/vhost_blk/vhost_blk.c

index 5c64071..54f81b3 100644 (file)
@@ -685,7 +685,8 @@ new_device(int vid)
        /* start polling vring */
        worker_thread_status = WORKER_STATE_START;
        fprintf(stdout, "New Device %s, Device ID %d\n", path, vid);
-       if (pthread_create(&tid, NULL, &ctrlr_worker, ctrlr) < 0) {
+       if (rte_ctrl_thread_create(&tid, "vhostblk-ctrlr", NULL,
+                                  &ctrlr_worker, ctrlr) != 0) {
                fprintf(stderr, "Worker Thread Started Failed\n");
                return -1;
        }