aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2019-11-26 16:30:39 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-11-28 10:10:57 +0100
commit97264cb1f32b60bfce5a79a8c06d2b1b20875490 (patch)
tree5393d4019391964e7a96027574d617e3230ae754 /executor
parente8c04ab052f4c34900a6045d3bb51e8d02071902 (diff)
executor: Add debug message in case devlink namespace move fails
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Diffstat (limited to 'executor')
-rw-r--r--executor/common_linux.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h
index ca0d072fd..dabc13812 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -523,7 +523,7 @@ static void netlink_devlink_netns_move(const char* bus_name, const char* dev_nam
{
struct genlmsghdr genlhdr;
int sock;
- int id;
+ int id, err;
sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
if (sock == -1)
@@ -539,7 +539,11 @@ static void netlink_devlink_netns_move(const char* bus_name, const char* dev_nam
netlink_attr(&nlmsg, DEVLINK_ATTR_BUS_NAME, bus_name, strlen(bus_name) + 1);
netlink_attr(&nlmsg, DEVLINK_ATTR_DEV_NAME, dev_name, strlen(dev_name) + 1);
netlink_attr(&nlmsg, DEVLINK_ATTR_NETNS_FD, &netns_fd, sizeof(netns_fd));
- netlink_send(&nlmsg, sock);
+ err = netlink_send(&nlmsg, sock);
+ if (err) {
+ debug("netlink: failed to move devlink instance %s/%s into network namespace: %s\n",
+ bus_name, dev_name, strerror(err));
+ }
error:
close(sock);
}