bonding: kernel bonding device creation

Creates virtual kernel devices as needed. Since the manager is
initialized after the connections have been loaded no
CONNECTIONS_ADDED notification is received for connections parsed
at startup.

Therefore walks the loaded connections looking for bonding
connections.

Connections added on the fly are handled via the notifications.

Connection renaming and deleting is not supported yet.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
This commit is contained in:
Thomas Graf
2011-10-18 13:48:44 +02:00
committed by Dan Williams
parent a2a0d78818
commit 095aff0c21
4 changed files with 130 additions and 7 deletions

View File

@@ -68,7 +68,14 @@ __rtnl_link_alloc_cache (struct nl_sock *h, struct nl_cache **cache)
/* functions with similar prototypes */
#define nlmsg_datalen nlmsg_len
#endif
static inline int
rtnl_link_bond_add (struct nl_sock *h, const char *name, void *data)
{
/* Bonding only in libnl3 */
return -NLE_OPNOTSUPP;
}
#endif /* HAVE_LIBNL2 */
/* libnl-1.0 compat functions */
@@ -214,6 +221,14 @@ static inline int __genl_ctrl_alloc_cache(struct nl_sock *h, struct nl_cache **c
#define NLE_NOACCESS 27
#define NLE_PERM 28
#define NLE_PKTLOC_FILE 29
#endif
static inline int
rtnl_link_bond_add (struct nl_sock *h, const char *name, void *data)
{
/* Bonding only in libnl3 */
return -NLE_OPNOTSUPP;
}
#endif /* HAVE_LIBNL1 */
#endif /* NM_NETLINK_COMPAT_H */