fi
dnl
-dnl check for kernel headers required by devlink
+dnl check for DEVLINK_CMD_ESWITCH_GET
+dnl
+dnl Assume DEVLINK_ESWITCH_MODE_SWITCHDEV is also
+dnl available, as it was introudced in kernel 4.8
+dnl along with the original spelling of this constant
+dnl (DEVLINK_CMD_ESWITCH_MODE_GET, not supported by libvirt)
dnl
if test "$with_linux" = "yes"; then
AC_CHECK_HEADERS([linux/devlink.h])
- AC_CHECK_DECLS([DEVLINK_GENL_VERSION, DEVLINK_GENL_NAME, DEVLINK_ATTR_MAX, DEVLINK_CMD_ESWITCH_GET, DEVLINK_ATTR_BUS_NAME, DEVLINK_ATTR_DEV_NAME, DEVLINK_ATTR_ESWITCH_MODE, DEVLINK_ESWITCH_MODE_SWITCHDEV],
- [AC_DEFINE([HAVE_DECL_DEVLINK],
- [1],
- [whether devlink declarations are available])],
- [],
+ AC_CHECK_DECLS([DEVLINK_CMD_ESWITCH_GET], [], [],
[[#include <linux/devlink.h>]])
fi
# include <net/if_dl.h>
#endif
-#if HAVE_DECL_DEVLINK
+#if HAVE_LINUX_DEVLINK_H
# include <linux/devlink.h>
#endif
}
-# if HAVE_DECL_DEVLINK
+# if HAVE_DECL_DEVLINK_CMD_ESWITCH_GET
/**
* virNetDevPutExtraHeader
* reserve and prepare room for an extra header