hotplug: vif: fail if a duplicate vifname is used.
authorIan Campbell <ian.campbell@citrix.com>
Mon, 23 Jul 2012 12:09:46 +0000 (13:09 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 23 Jul 2012 12:09:46 +0000 (13:09 +0100)
commit931116a29046a91fa072d0cae4523ee9e8529c4f
tree6c79b5ecbb1d658955cbfcb6e50f2655ce8038ae
parented78b8ba6619d054020b2738eabe323ca4a25d68
hotplug: vif: fail if a duplicate vifname is used.

This is based on a patch from Hans van Kranenburg in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=658305. Quoting that bug
report:

    When configurating a duplicate custom vifname for interfaces in the Xen
    dom0 that are added to a bridge (which is obviously a configuration error),
    the hotplug scripts fail silently to rename the new vifX.0 to
    the custom vifname, if it's already existing.

    The result of this, is that the domU will start normally, but no network
    traffic between domU and the dom0 bridge is possible, because the vifX.0
    never gets added to the bridge.

    Worse... when doing xm shutdown on the newly created domU, while
    investigating the issue, the interface of another running domU gets shut
    down, and remains hanging around in a DOWN state, because it cannot be
    removed (the other unrelated domU is still running, but succesfully made
    unavailable on the network!).

    When starting the new domU again, the interface of the other domU will
    be added to the bridge again, and while looking at the output of brctl
    show, tcpdump and ping, which make no sense, because everything will
    seem to be right, nagios will notify you of another host being down. :|

Note that libxl doesn't actually check the hotplug status yet, this changes
with Rogers hotplug script changes. xend correctly picks the failure up.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/hotplug/Linux/vif-common.sh