[jump vnet] Fix udev rule event for older libvirt 07/61407/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 27 Aug 2018 02:58:03 +0000 (04:58 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 27 Aug 2018 02:58:03 +0000 (04:58 +0200)
Older libvirt seems to raise 'change' events instead of 'add',
so the MTU bump of the libvirt managed tap interfaces was not
properly applied.

Change-Id: Ie1a4f1c4f235ad4f83bf9ee218a40dcedc1ce914
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
mcp/scripts/lib.sh

index 5f1275d..016af2b 100644 (file)
@@ -550,7 +550,7 @@ function wait_for {
 function do_udev_cfg {
   local _conf='/etc/udev/rules.d/99-opnfv-fuel-vnet-mtu.rules'
   # http://linuxaleph.blogspot.com/2013/01/how-to-network-jumbo-frames-to-kvm-guest.html
-  echo 'SUBSYSTEM=="net", ACTION=="add", KERNEL=="vnet*", RUN+="/sbin/ip link set mtu 9000 dev '"'"%k"'"'"' |& sudo tee "${_conf}"
+  echo 'SUBSYSTEM=="net", ACTION=="add|change", KERNEL=="vnet*", ATTR{mtu}="9000"' |& sudo tee "${_conf}"
   sudo udevadm control --reload || true
 }