From 00456ddda4110f7f75ea9f8a703b31c7f2df7649 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Fri, 17 Sep 2010 08:23:32 -0700 Subject: [PATCH] xenserver: monitor-external-ids remove redundant ovs-vsctl calls The number of ovs-vsctl calls required to add a new vif in monitor-external-ids grew linearly with the number of vifs in the system. Changed to only do O(1) ovs-vsctl calls per vif addition. --- .../usr_share_openvswitch_scripts_monitor-external-ids | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xenserver/usr_share_openvswitch_scripts_monitor-external-ids b/xenserver/usr_share_openvswitch_scripts_monitor-external-ids index a28ce6090..a0aad7a0e 100755 --- a/xenserver/usr_share_openvswitch_scripts_monitor-external-ids +++ b/xenserver/usr_share_openvswitch_scripts_monitor-external-ids @@ -227,13 +227,15 @@ def main(argv): if name not in bridges: update_network_uuids(name, ids) - update_bridge_id(name, ids) + if (name not in bridges) or (bridges[name] != ids): + update_bridge_id(name, ids) bridges = new_bridges if interfaces != new_interfaces: for name,ids in new_interfaces.items(): - update_iface_id(name, ids) + if (name not in interfaces) or (interfaces[name] != ids): + update_iface_id(name, ids) interfaces = new_interfaces if __name__ == '__main__': -- 2.43.0