diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 4fedc2b705..7bcfc0d965 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -364,6 +364,16 @@ static int virLXCControllerGetNICIndexes(virLXCControllerPtr ctrl) size_t i; int ret = -1; + /* Gather the ifindexes of the "parent" veths for all interfaces + * implemented with a veth pair. These will be used when calling + * virCgroupNewMachine (and eventually the dbus method + * CreateMachineWithNetwork). ifindexes for the child veths, and + * for macvlan interfaces, *should not* be in this list, as they + * will be moved into the container. Only the interfaces that will + * remain outside the container, but are used for communication + * with the container, should be added to the list. + */ + VIR_DEBUG("Getting nic indexes"); for (i = 0; i < ctrl->def->nnets; i++) { int nicindex = -1; @@ -387,6 +397,9 @@ static int virLXCControllerGetNICIndexes(virLXCControllerPtr ctrl) ctrl->nicindexes[ctrl->nnicindexes-1] = nicindex; break; + case VIR_DOMAIN_NET_TYPE_DIRECT: + break; + case VIR_DOMAIN_NET_TYPE_USER: case VIR_DOMAIN_NET_TYPE_VHOSTUSER: case VIR_DOMAIN_NET_TYPE_SERVER: @@ -394,7 +407,6 @@ static int virLXCControllerGetNICIndexes(virLXCControllerPtr ctrl) case VIR_DOMAIN_NET_TYPE_MCAST: case VIR_DOMAIN_NET_TYPE_UDP: case VIR_DOMAIN_NET_TYPE_INTERNAL: - case VIR_DOMAIN_NET_TYPE_DIRECT: case VIR_DOMAIN_NET_TYPE_HOSTDEV: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported net type %s"),