vswitch: Fix duplicated DPIDs observed under XenServer.
The procedure for choosing a bridge MAC address will, in the most
ordinary case, also choose a unique MAC that we can use as a datapath
ID. In some special cases, though, multiple bridges will end up with
the same MAC address. This is OK for the bridges, but it will confuse
the OpenFlow controller, because each datapath needs a unique datapath
ID, so this commit adds some support for two common special cases on
XenServer where DPIDs were not unique.
It is also very desirable that they be stable from one run to the
next, so that policy set on a datapath "sticks".
The special cases handled by this commit are:
1. A bridge whose MAC address is taken from a VLAN network device
(that is, a network device created with vconfig(8) or similar tool)
will have the same MAC address as a bridge on the VLAN device's
physical network device.
We handle this case by hashing the physical network device MAC
along with the VLAN identifier.
2. A purely internal bridge, that is, one that has no non-virtual
network devices on it at all, is more difficult because it has no
natural unique identifier at all.
When the host is a XenServer, we handle this case by asking "xe"
for the internal bridge's plaintext name (e.g. "Internal Network
1") and hashing that together with the XenServer's host UUID.
When the host is not a XenServer, we punt by using a random MAC
address on each run.