vhost: print reason of NUMA node query failure
authorIlya Maximets <i.maximets@samsung.com>
Thu, 6 Jul 2017 13:30:43 +0000 (16:30 +0300)
committerYuanhan Liu <yliu@fridaylinux.org>
Fri, 7 Jul 2017 00:17:56 +0000 (02:17 +0200)
syscall always returns '-1' on failure and there is no point
in printing that value. 'errno' is much more informative.

Fixes: 586e39001317 ("vhost: export numa node")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost.c

index 653152f..0b6aa1c 100644 (file)
@@ -40,6 +40,7 @@
 #include <numaif.h>
 #endif
 
+#include <rte_errno.h>
 #include <rte_ethdev.h>
 #include <rte_log.h>
 #include <rte_string_fns.h>
@@ -295,7 +296,8 @@ rte_vhost_get_numa_node(int vid)
                            MPOL_F_NODE | MPOL_F_ADDR);
        if (ret < 0) {
                RTE_LOG(ERR, VHOST_CONFIG,
-                       "(%d) failed to query numa node: %d\n", vid, ret);
+                       "(%d) failed to query numa node: %s\n",
+                       vid, rte_strerror(errno));
                return -1;
        }