- local vm=$(xenstore-read "/local/domain/$DOMID/vm" 2>/dev/null)
- if [ $? -eq 0 -a -n "${vm}" ] ; then
- local vm_uuid=$(xenstore-read "$vm/uuid" 2>/dev/null)
- fi
- if [ -n "${vm_uuid}" ] ; then
- vif_details="$vif_details --add=port.${dev}.vm-uuid=${vm_uuid}"
+xs550_set_internal_network_uuid()
+{
+ if $xs550; then
+ # vNetManager needs to know the network UUID(s) associated with each
+ # datapath. Normally interface-reconfigure adds them, but XAPI does
+ # not use interface-reconfigure for internal networks. Instead, XAPI
+ # calls the addbr ioctl internally, so we have to do it here instead
+ # for internal networks. This is only acceptable because xapi is lazy
+ # about creating internal networks: it only creates one just before it
+ # adds the first vif to it. There may still be a brief delay between
+ # the initial ovs-vswitchd connection to vNetManager and setting this
+ # configuration variable, but vNetManager can tolerate that.
+ local bridge=$1
+ local net_uuid=$(xenstore-read "${PRIVATE}/network-uuid" 2>/dev/null)
+ if [ -n "${net_uuid}" ] ; then
+ logger -t scripts-vif "${bridge} network-uuids ${net_uuid}"
+ echo "-- br-set-external-id $bridge network-uuids ${net_uuid}"
+ fi