Note that while vethoLdAjv has both kernel and udev add and remove, veth7t59jJ
has only the add messages.
My previous comment is likely wrong, because the *renamed* veth7t59jJ (eth0
in the container namespace) does have remove messages, and no add messages.
(My point here being that since we see those messages, for an eth0 in another
network namespace, then we should also be seeing the messages for a veth7t59jJ
while being moved to a new netns if those were being sent - the virtual 'eth0'
does not have a /sys/class/net entry in the initial network namespace either)
Therefore it seems most likely that the kernel is not actually sending the
remove/add messages when a netdev is moved to a new namespace, nor giving
hints when the netdev is renamed (which lxc does after moving it to a new
namespace, obviously, to prevent name conflicts with 'eth0').
SO - lxc could finagle this by emitting upstart signals at
src/lxc/conf.c:lxc_assign_network() or
src/lxc/network.c:lxc_network_move_by_index(), but first it's worth considering
whether the kernel should be sending signals.
Running 'udevadm monitor' while starting and stopping a container gives:
KERNEL[ 17237.641503] add /devices/ virtual/ net/veth7t59jJ (net) 17237.644300] add /devices/ virtual/ net/veth7t59jJ/ queues/ rx-0 (queues) 17237.644577] add /devices/ virtual/ net/veth7t59jJ/ queues/ tx-0 (queues) 17237.644855] add /devices/ virtual/ net/vethoLdAjv (net) 17237.644906] add /devices/ virtual/ net/vethoLdAjv/ queues/ rx-0 (queues) 17237.644934] add /devices/ virtual/ net/vethoLdAjv/ queues/ tx-0 (queues) 17237.649498] add /kernel/ slab/nf_ conntrack_ ffff88007a72000 0 (slab) 17237.652309] add /devices/ virtual/ net/lo/ queues/ rx-0 (queues) 17237.652348] add /devices/ virtual/ net/lo/ queues/ tx-0 (queues) virtual/ net/lo/ queues/ tx-0 (queues) virtual/ net/lo/ queues/ rx-0 (queues) slab/nf_ conntrack_ ffff88007a72000 0 (slab) virtual/ net/veth7t59jJ (net) virtual/ net/veth7t59jJ/ queues/ rx-0 (queues) virtual/ net/veth7t59jJ/ queues/ tx-0 (queues) virtual/ net/vethoLdAjv (net) virtual/ net/vethoLdAjv/ queues/ rx-0 (queues) virtual/ net/vethoLdAjv/ queues/ tx-0 (queues) 17244.427892] remove /devices/ virtual/ net/eth0/ queues/ rx-0 (queues) virtual/ net/eth0/ queues/ rx-0 (queues) 17244.429466] remove /devices/ virtual/ net/eth0/ queues/ tx-0 (queues) virtual/ net/eth0/ queues/ tx-0 (queues) 17244.431075] remove /devices/ virtual/ net/vethoLdAjv/ queues/ rx-0 (queues) virtual/ net/vethoLdAjv/ queues/ rx-0 (queues) 17244.432570] remove /devices/ virtual/ net/vethoLdAjv/ queues/ tx-0 (queues) virtual/ net/vethoLdAjv/ queues/ tx-0 (queues) 17244.435509] remove /devices/ virtual/ net/vethoLdAjv (net) virtual/ net/vethoLdAjv (net) 17244.440529] remove /devices/ virtual/ net/lo/ queues/ rx-0 (queues) virtual/ net/lo/ queues/ rx-0 (queues) 17244.441098] remove /devices/ virtual/ net/lo/ queues/ tx-0 (queues) virtual/ net/lo/ queues/ tx-0 (queues) 17244.706760] remove /kernel/ slab/nf_ conntrack_ ffff88007a72000 0 (slab) slab/nf_ conntrack_ ffff88007a72000 0 (slab)
KERNEL[
KERNEL[
KERNEL[
KERNEL[
KERNEL[
KERNEL[
KERNEL[
KERNEL[
UDEV [17237.657166] add /devices/
UDEV [17237.659337] add /devices/
UDEV [17237.659652] add /kernel/
UDEV [17237.679686] add /devices/
UDEV [17237.680836] add /devices/
UDEV [17237.681041] add /devices/
UDEV [17237.698158] add /devices/
UDEV [17237.699761] add /devices/
UDEV [17237.699948] add /devices/
KERNEL[
UDEV [17244.429127] remove /devices/
KERNEL[
UDEV [17244.429918] remove /devices/
KERNEL[
UDEV [17244.431564] remove /devices/
KERNEL[
UDEV [17244.433942] remove /devices/
KERNEL[
UDEV [17244.436596] remove /devices/
KERNEL[
UDEV [17244.440979] remove /devices/
KERNEL[
UDEV [17244.441492] remove /devices/
KERNEL[
UDEV [17244.707342] remove /kernel/
Note that while vethoLdAjv has both kernel and udev add and remove, veth7t59jJ
has only the add messages.
My previous comment is likely wrong, because the *renamed* veth7t59jJ (eth0
in the container namespace) does have remove messages, and no add messages.
(My point here being that since we see those messages, for an eth0 in another
network namespace, then we should also be seeing the messages for a veth7t59jJ
while being moved to a new netns if those were being sent - the virtual 'eth0'
does not have a /sys/class/net entry in the initial network namespace either)
Therefore it seems most likely that the kernel is not actually sending the
remove/add messages when a netdev is moved to a new namespace, nor giving
hints when the netdev is renamed (which lxc does after moving it to a new
namespace, obviously, to prevent name conflicts with 'eth0').
SO - lxc could finagle this by emitting upstart signals at conf.c: lxc_assign_ network( ) or network. c:lxc_network_ move_by_ index() , but first it's worth considering
src/lxc/
src/lxc/
whether the kernel should be sending signals.