xenserver: Remove dump-vif-details script.
authorBen Pfaff <blp@nicira.com>
Fri, 26 Feb 2010 22:11:09 +0000 (14:11 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 2 Mar 2010 20:20:48 +0000 (12:20 -0800)
It is no longer used.

Signed-off-by: Ben Pfaff <blp@nicira.com>
xenserver/README
xenserver/automake.mk
xenserver/etc_xensource_scripts_vif
xenserver/usr_share_vswitch_scripts_dump-vif-details [deleted file]
xenserver/vswitch-xen.spec

index ff692fd3f1ea355a370e5fffb2169d2a35a1a5a6..e35da5ac5bbb8b4b06f9bd4288a38c55293040f4 100644 (file)
@@ -44,12 +44,6 @@ files are:
 
         vswitch-aware replacement for Citrix script of the same name.
 
-    root_vswitch_scripts_dump-vif-details
-
-        Script to retrieve extended information about VIFs that are
-        needed by the controller.  This is called by the "vif" script,
-        which is run when virtual interfaces are added and removed.
-
     usr_share_vswitch_scripts_refresh-xs-network-uuids
 
         Script to refresh bridge.<bridge>.xs-network-uuids keys, which
index 1b930454d795884362553b67b97a4bb0c6651058..c65b132636dddd65f08aaed774ee12b76c4cc892 100644 (file)
@@ -22,7 +22,6 @@ EXTRA_DIST += \
        xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \
        xenserver/usr_sbin_brctl \
        xenserver/usr_sbin_xen-bugtool \
-       xenserver/usr_share_vswitch_scripts_dump-vif-details \
        xenserver/usr_share_vswitch_scripts_refresh-xs-network-uuids \
        xenserver/usr_share_vswitch_scripts_sysconfig.template \
        xenserver/vswitch-xen.spec
index 90151d1fb3e337b64d5c7cb5ef882d35fc493be4..c81358a2c82a9caf9db6123fe3d93b0b24e2e2b4 100755 (executable)
@@ -24,7 +24,6 @@ BRCTL="/usr/sbin/brctl"
 IP="/sbin/ip"
 
 vsctl="/usr/bin/ovs-vsctl"
-dump_vif_details="/usr/share/vswitch/scripts/dump-vif-details"
 
 handle_promiscuous()
 {
diff --git a/xenserver/usr_share_vswitch_scripts_dump-vif-details b/xenserver/usr_share_vswitch_scripts_dump-vif-details
deleted file mode 100755 (executable)
index 430ec54..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/python
-#
-# Script to retrieve extended information about VIFs that are
-# needed by the controller.  This is called by the "vif" script,
-# which is run when virtual interfaces are added and removed.
-
-# Copyright (C) 2009, 2010 Nicira Networks, Inc.
-#
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved.  This file is offered as-is,
-# without warranty of any kind.
-
-import sys
-import XenAPI
-import xen.lowlevel.xs
-
-# Query XenStore for the opaque reference of this vif
-def get_vif_ref(domid, devid):
-       xenstore = xen.lowlevel.xs.xs()
-       t = xenstore.transaction_start()
-       vif_ref = xenstore.read(t, '/xapi/%s/private/vif/%s/ref' % (domid, devid))
-       xenstore.transaction_end(t)
-       return vif_ref
-
-# Query XAPI for the information we need using the vif's opaque reference
-def dump_vif_info(domid, devid, vif_ref):
-       session = XenAPI.xapi_local()
-       session.xenapi.login_with_password("root", "")
-       try: 
-               vif_rec = session.xenapi.VIF.get_record(vif_ref)
-               net_rec = session.xenapi.network.get_record(vif_rec["network"])
-               vm_uuid = session.xenapi.VM.get_uuid(vif_rec["VM"])
-
-               # Data to allow vNetManager to associate VIFs with xapi data
-               vif_info = []
-               vif_info.append(('xs-network-uuid', net_rec["uuid"]))
-               vif_info.append(('xs-vif-mac', vif_rec["MAC"]))
-               vif_info.append(('xs-vif-uuid', vif_rec["uuid"]))
-               vif_info.append(('xs-vm-uuid', vm_uuid))
-               for key, value in vif_info:
-                       print("-- set interface vif%s.%s external-ids:\"%s\"=\"%s\""
-                             % (domid, devid, key, value))
-
-               # vNetManager needs to know the network UUID(s) associated with
-               # each datapath.  Normally interface-reconfigure adds them, but
-               # interface-reconfigure never gets called for internal networks
-               # (xapi does 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.
-               if not net_rec['PIFs']:
-                       bridge = net_rec['bridge']
-
-                       xs_network_uuid = net_rec['uuid']
-                       print("-- br-set-external-id %s %s %s"
-                             % (bridge, "xs-network-uuids", xs_network_uuid))
-
-                       xs_network_name = net_rec['name_label']
-                       print("-- br-set-external-id %s %s %s"
-                             % (bridge, "xs-network-names", xs_network_name))
-       finally:
-               session.xenapi.session.logout()
-       
-if __name__ == '__main__':
-       if len(sys.argv) != 3:
-               sys.stderr.write("ERROR: %s <domid> <devid>\n" % sys.argv[0])
-               sys.exit(1)
-
-       domid = sys.argv[1]
-       devid = sys.argv[2]
-
-       vif_ref = get_vif_ref(domid, devid)
-       if not vif_ref:
-               sys.stderr.write("ERROR: Could not find interface vif%s.%s\n" 
-                                % (domid, devid))
-               sys.exit(1)
-
-       dump_vif_info(domid, devid, vif_ref)
-       sys.exit(0)
index d3211fb57bb1d04e49f9967f32c6de85ac571019..182edb6ea9e358f287b239ad5b211f0639a7e58b 100644 (file)
@@ -79,8 +79,6 @@ install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py \
              $RPM_BUILD_ROOT/usr/share/vswitch/scripts/InterfaceReconfigureVswitch.py
 install -m 755 xenserver/etc_xensource_scripts_vif \
              $RPM_BUILD_ROOT/usr/share/vswitch/scripts/vif
-install -m 755 xenserver/usr_share_vswitch_scripts_dump-vif-details \
-               $RPM_BUILD_ROOT/usr/share/vswitch/scripts/dump-vif-details
 install -m 755 xenserver/usr_share_vswitch_scripts_refresh-xs-network-uuids \
                $RPM_BUILD_ROOT/usr/share/vswitch/scripts/refresh-xs-network-uuids
 install -m 755 xenserver/usr_sbin_xen-bugtool \
@@ -340,7 +338,6 @@ fi
 %if %(echo '%{xen_version}'|awk -F"." '{if ($3>=18) print 1; else print 0;}')
 /lib/modules/%{xen_version}/kernel/net/vswitch/ip_gre_mod.ko
 %endif
-/usr/share/vswitch/scripts/dump-vif-details
 /usr/share/vswitch/scripts/refresh-xs-network-uuids
 /usr/share/vswitch/scripts/interface-reconfigure
 /usr/share/vswitch/scripts/InterfaceReconfigure.py