From: Justin Pettit Date: Mon, 9 Aug 2010 22:07:32 +0000 (-0700) Subject: xenserver: Prepend XenServer external ids with "xs-" X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c76fde78c528027fe95d714aba5ccf0f01407d75;p=openvswitch xenserver: Prepend XenServer external ids with "xs-" Signed-off-by: Justin Pettit --- diff --git a/tests/interface-reconfigure.at b/tests/interface-reconfigure.at index 69f9830a..880f4a50 100644 --- a/tests/interface-reconfigure.at +++ b/tests/interface-reconfigure.at @@ -654,7 +654,7 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xenbr2 configuration --may-exist add-br xenbr2 --may-exist add-port xenbr2 eth2 set Bridge xenbr2 other-config:hwaddr="00:15:17:a0:29:80" - br-set-external-id xenbr2 network-uuids d08c8749-0c8f-9e8d-ce25-fd364661ee99 + br-set-external-id xenbr2 xs-network-uuids d08c8749-0c8f-9e8d-ce25-fd364661ee99 /sbin/ifup xenbr2 /sbin/update-issue Committing changes to /etc/sysconfig/network-scripts/route-xenbr2 configuration @@ -717,10 +717,10 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi3 configuration --may-exist add-br xenbr3 --may-exist add-port xenbr3 eth3 set Bridge xenbr3 other-config:hwaddr="00:15:17:a0:29:81" - br-set-external-id xenbr3 network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6 + br-set-external-id xenbr3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6 --if-exists del-br xapi3 --may-exist add-br xapi3 xenbr3 123 - br-set-external-id xapi3 network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6 + br-set-external-id xapi3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6 set Interface xapi3 MAC="00:15:17:a0:29:81" /sbin/ifup xapi3 /sbin/update-issue @@ -802,7 +802,7 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi1 configuration --fake-iface add-bond xapi1 bond0 eth0 eth1 set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:"bond-miimon"=100 other-config:"bond-use_carrier"=1 other-config:"bond-mode"="balance-slb" bond_updelay=31000 set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af" - br-set-external-id xapi1 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef + br-set-external-id xapi1 xs-network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef /sbin/ifup xapi1 action_up: bring up bond0 /sbin/ifconfig bond0 up @@ -883,10 +883,10 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration --fake-iface add-bond xapi1 bond0 eth0 eth1 set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:"bond-miimon"=100 other-config:"bond-use_carrier"=1 other-config:"bond-mode"="balance-slb" bond_updelay=31000 set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af" - br-set-external-id xapi1 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef + br-set-external-id xapi1 xs-network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef --if-exists del-br xapi2 --may-exist add-br xapi2 xapi1 4 - br-set-external-id xapi2 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef + br-set-external-id xapi2 xs-network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef set Interface xapi2 MAC="00:22:19:22:4b:af" /sbin/ifup xapi2 action_up: bring up bond0 diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 7d61aac7..38dc6a1a 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -364,7 +364,7 @@ column), external IDs for the fake bridge are defined here by prefixing a key with fake-bridge-, - e.g. fake-bridge-network-uuids. + e.g. fake-bridge-xs-network-uuids.

diff --git a/xenserver/README b/xenserver/README index 3b7809fc..db2bd297 100644 --- a/xenserver/README +++ b/xenserver/README @@ -49,9 +49,9 @@ files are: Open vSwitch-aware replacement for Citrix script of the same name. - usr_share_openvswitch_scripts_refresh-network-uuids + usr_share_openvswitch_scripts_refresh-xs-network-uuids - Script to refresh Bridge table external-ids:network-uuids + Script to refresh Bridge table external-ids:xs-network-uuids values, which can get out-of-sync following a pool join. usr_share_openvswitch_scripts_sysconfig.template diff --git a/xenserver/automake.mk b/xenserver/automake.mk index b16fef9b..fa5b466c 100644 --- a/xenserver/automake.mk +++ b/xenserver/automake.mk @@ -23,6 +23,6 @@ EXTRA_DIST += \ xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \ xenserver/usr_sbin_brctl \ xenserver/usr_sbin_xen-bugtool \ - xenserver/usr_share_openvswitch_scripts_refresh-network-uuids \ + xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids \ xenserver/usr_share_openvswitch_scripts_sysconfig.template \ xenserver/uuid.py diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif index fe852052..91b75c12 100755 --- a/xenserver/etc_xensource_scripts_vif +++ b/xenserver/etc_xensource_scripts_vif @@ -92,7 +92,7 @@ handle_vswitch_vif_details() local vm_uuid=$(xenstore-read "$vm/uuid" 2>/dev/null) fi if [ -n "${vm_uuid}" ] ; then - set_vif_external_id "vm-uuid" "${vm_uuid}" + set_vif_external_id "xs-vm-uuid" "${vm_uuid}" fi local vif_uuid=$(xenstore-read "${PRIVATE}/vif-uuid" 2>/dev/null) @@ -100,7 +100,7 @@ handle_vswitch_vif_details() vif_uuid=$(xe vif-list --minimal vm-uuid="${vm_uuid}" device=$DEVID) fi if [ -n "${vif_uuid}" ] ; then - set_vif_external_id "vif-uuid" "${vif_uuid}" + set_vif_external_id "xs-vif-uuid" "${vif_uuid}" fi local vif_details= @@ -109,12 +109,12 @@ handle_vswitch_vif_details() net_uuid=$(xe vif-param-get uuid="${vif_uuid}" param-name=network-uuid) fi if [ -n "${net_uuid}" ] ; then - set_vif_external_id "network-uuid" "${net_uuid}" + set_vif_external_id "xs-network-uuid" "${net_uuid}" fi local address=$(xenstore-read "/local/domain/$DOMID/device/vif/$DEVID/mac" 2>/dev/null) if [ -n "${address}" ] ; then - set_vif_external_id "vif-mac" "${address}" + set_vif_external_id "xs-vif-mac" "${address}" fi if $xs550; then @@ -129,8 +129,8 @@ handle_vswitch_vif_details() # configuration variable, but vNetManager can tolerate that. local bridge=$1 if [ -n "${net_uuid}" ] ; then - logger -t scripts-vif "${bridge} network-uuids ${net_uuid}" - echo "-- br-set-external-id $bridge network-uuids ${net_uuid}" + logger -t scripts-vif "${bridge} xs-network-uuids ${net_uuid}" + echo "-- br-set-external-id $bridge xs-network-uuids ${net_uuid}" fi fi } diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec index f693ea0d..80dbec70 100644 --- a/xenserver/openvswitch-xen.spec +++ b/xenserver/openvswitch-xen.spec @@ -73,8 +73,8 @@ install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py \ $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/InterfaceReconfigureVswitch.py install -m 755 xenserver/etc_xensource_scripts_vif \ $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/vif -install -m 755 xenserver/usr_share_openvswitch_scripts_refresh-network-uuids \ - $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/refresh-network-uuids +install -m 755 xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids \ + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/refresh-xs-network-uuids install -m 755 xenserver/usr_sbin_xen-bugtool \ $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/xen-bugtool install -m 755 xenserver/usr_sbin_brctl \ @@ -158,12 +158,12 @@ EOF fi fi -# On XenServer 5.5.0, we need refresh-network-uuids to run whenever +# On XenServer 5.5.0, we need refresh-xs-network-uuids to run whenever # XAPI starts or restarts. (On XenServer 5.6.0, XAPI calls the # "update" method of the vswitch-cfg-update plugin whenever it starts # or restarts, so this is no longer necessary.) if test "$PRODUCT_VERSION" = "5.5.0"; then - RNU=/usr/share/openvswitch/scripts/refresh-network-uuids + RNU=/usr/share/openvswitch/scripts/refresh-xs-network-uuids XSS=/opt/xensource/libexec/xapi-startup-script if test -e $XSS && (test ! -L $XSS || test "`readlink $XSS`" != $RNU); then echo "$XSS is already in use, refusing to overwrite" @@ -390,7 +390,7 @@ fi /usr/share/openvswitch/python/ovs/timeval.py /usr/share/openvswitch/python/ovs/util.py /usr/share/openvswitch/python/uuid.py -/usr/share/openvswitch/scripts/refresh-network-uuids +/usr/share/openvswitch/scripts/refresh-xs-network-uuids /usr/share/openvswitch/scripts/interface-reconfigure /usr/share/openvswitch/scripts/InterfaceReconfigure.py /usr/share/openvswitch/scripts/InterfaceReconfigureBridge.py diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py index ef2f1fe6..bc311f80 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py @@ -345,9 +345,9 @@ def set_br_external_ids(pif): xs_network_uuids += [nwrec['uuid']] vsctl_argv = [] - vsctl_argv += ['# configure network-uuids'] + vsctl_argv += ['# configure xs-network-uuids'] vsctl_argv += ['--', 'br-set-external-id', pif_bridge_name(pif), - 'network-uuids', ';'.join(xs_network_uuids)] + 'xs-network-uuids', ';'.join(xs_network_uuids)] return vsctl_argv diff --git a/xenserver/usr_share_openvswitch_scripts_refresh-network-uuids b/xenserver/usr_share_openvswitch_scripts_refresh-network-uuids deleted file mode 100755 index 42ebe06e..00000000 --- a/xenserver/usr_share_openvswitch_scripts_refresh-network-uuids +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -exec /opt/xensource/libexec/interface-reconfigure rewrite diff --git a/xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids b/xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids new file mode 100755 index 00000000..42ebe06e --- /dev/null +++ b/xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids @@ -0,0 +1,2 @@ +#! /bin/sh +exec /opt/xensource/libexec/interface-reconfigure rewrite