tools/hotplug/Linux: modify set_mtu() to optionally use a configured value...
authorPaul Durrant <pdurrant@amazon.com>
Tue, 11 Aug 2020 08:02:00 +0000 (09:02 +0100)
committerWei Liu <wl@xen.org>
Thu, 27 Aug 2020 10:04:21 +0000 (10:04 +0000)
commitc7c6de0cb9b00efc203790743ef8c37ba113d3ee
treee35b193fcd32fa12e49fe075674ab6d19c55c408
parent22cdff931d1239156dea74d8b4a50e91e44c5817
tools/hotplug/Linux: modify set_mtu() to optionally use a configured value...

...and also inform the frontend.

The set_mtu() function in xen-network-common.sh currently sets the backend
vif MTU to match that of the bridge.

A prior patch added code into libxl such that a tools-configured 'mtu' value
may be present in the xenstore backend area. If the node is present in
xenstore then it should be authoritative. Hence set_mtu() is modified to only
read the MTU of the bridge if it is not present.

The function is also modified to write whatever value it applies to the
backend vif into the xenstore frontend area where is may then be used to
configure the frontend network stack.

NOTE: There is also a small modification replacing '$mtu' with '${mtu}'
      for style consistency.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Wei Liu <wl@xen.org>
tools/hotplug/Linux/vif-bridge
tools/hotplug/Linux/xen-network-common.sh