mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-02 19:31:18 +00:00
8db32571ba
Current implementation of lxc driver creates vethN named interface(s) in the host and passes as it is to a container. The reason why it doesn't use ethN is due to the limitation that one namespace cannot have multiple iterfaces that have an identical name so that we give up creating ethN named interface in the host for the container. However, we should be able to allow the container to have ethN by changing the name after clone(CLONE_NEWNET). * src/lxc/lxc_container.c src/lxc/veth.c src/lxc/veth.h: do the clone and then renames interfaces eth0 ... ethN to keep the interface names familiar in the domain
27 lines
673 B
C
27 lines
673 B
C
/*
|
|
* veth.h: Interface to tools for managing veth pairs
|
|
*
|
|
* Copyright IBM Corp. 2008
|
|
*
|
|
* See COPYING.LIB for the License of this software
|
|
*
|
|
* Authors:
|
|
* David L. Leskovec <dlesko at linux.vnet.ibm.com>
|
|
*/
|
|
|
|
#ifndef VETH_H
|
|
#define VETH_H
|
|
|
|
#include <config.h>
|
|
|
|
/* Function declarations */
|
|
int vethCreate(char* veth1, int veth1MaxLen, char* veth2,
|
|
int veth2MaxLen);
|
|
int vethDelete(const char* veth);
|
|
int vethInterfaceUpOrDown(const char* veth, int upOrDown);
|
|
int moveInterfaceToNetNs(const char *iface, int pidInNs);
|
|
int setMacAddr(const char* iface, const char* macaddr);
|
|
int setInterfaceName(const char* iface, const char* new);
|
|
|
|
#endif /* VETH_H */
|