From 97264cb1f32b60bfce5a79a8c06d2b1b20875490 Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Tue, 26 Nov 2019 16:30:39 +0100 Subject: executor: Add debug message in case devlink namespace move fails Signed-off-by: Jiri Pirko --- executor/common_linux.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'executor') 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); } -- cgit mrf-deployment