|
|
|
|
|
|
|
|
|
|
xen-api
[Xen-API] [PATCH 20 of 33] interface-reconfigure: add pif_is_bond()
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r 5883cee5ce9f -r 4992b8f5eff0 scripts/interface-reconfigure
--- a/scripts/interface-reconfigure Fri Dec 18 14:16:32 2009 +0000
+++ b/scripts/interface-reconfigure Fri Dec 18 14:16:32 2009 +0000
@@ -764,9 +764,7 @@
def create_bond_device(pif):
"""Ensures that a bond master device exists in the kernel."""
- pifrec = db.get_pif_record(pif)
-
- if len(pifrec['bond_master_of']) == 0:
+ if not pif_is_bond(pif):
return
__create_bond_device(pif_netdev_name(pif))
@@ -792,7 +790,7 @@
pifrec = db.get_pif_record(pif)
- if len(pifrec['bond_master_of']) == 0:
+ if not pif_is_bond(pif):
return
# If the bonding module isn't loaded then do nothing.
@@ -881,6 +879,11 @@
#
# Bonded PIFs
#
+def pif_is_bond(pif):
+ pifrec = db.get_pif_record(pif)
+
+ return len(pifrec['bond_master_of']) > 0
+
def pif_get_bond_masters(pif):
"""Returns a list of PIFs which are bond masters of this PIF"""
@@ -1064,11 +1067,9 @@
Returns the open file handle for the interface configuration file.
"""
- pifrec = db.get_pif_record(pif)
-
if pif_is_vlan(pif):
f = configure_vlan_interface(pif)
- elif len(pifrec['bond_master_of']) != 0:
+ elif pif_is_bond(pif):
f = configure_bond_interface(pif)
else:
f = configure_physical_interface(pif)
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-API] [PATCH 08 of 33] interface-reconfigure: drop "--force all down", (continued)
- [Xen-API] [PATCH 08 of 33] interface-reconfigure: drop "--force all down", Ian Campbell
- [Xen-API] [PATCH 09 of 33] interface-reconfigure: Reimplement forced rewrite, Ian Campbell
- [Xen-API] [PATCH 10 of 33] interface-reconfigure: Reformat some comments slightly, move logging function to top of file, Ian Campbell
- [Xen-API] [PATCH 11 of 33] interface-reconfigure: Add run_command utility to encapsulate os.spawnl usage, Ian Campbell
- [Xen-API] [PATCH 12 of 33] interface-reconfigure: Add pif_is_vlan utility function, Ian Campbell
- [Xen-API] [PATCH 13 of 33] interface-reconfigure: do not remove ifcfg files when unplugging a PIF, Ian Campbell
- [Xen-API] [PATCH 14 of 33] interface-reconfigure: Write DNSDEV to /etc/sysconfig/network, Ian Campbell
- [Xen-API] [PATCH 17 of 33] interface-reconfigure: Rename some functions to match vswitch version, Ian Campbell
- [Xen-API] [PATCH 15 of 33] interface-reconfigure: Various refactoring, Ian Campbell
- [Xen-API] [PATCH 18 of 33] interface-reconfigure: use the same other-config:ethtool-* and MTU as vswitch version, Ian Campbell
- [Xen-API] [PATCH 20 of 33] interface-reconfigure: add pif_is_bond(),
Ian Campbell <=
- [Xen-API] [PATCH 19 of 33] interface-reconfigure: further separate the concept of ipdev and datapath, Ian Campbell
- [Xen-API] [PATCH 21 of 33] interface-reconfigure: explicitly rename devices early, Ian Campbell
- [Xen-API] [PATCH 22 of 33] interface-reconfigure: move /etc/init.d/management-interface to this repository, Ian Campbell
- [Xen-API] [PATCH 23 of 33] interface-reconfigure: Do not try to bring down interfaces before forcing them up, Ian Campbell
- [Xen-API] [PATCH 24 of 33] interface-reconfigure: do not require a PIF for rewrite action, Ian Campbell
- [Xen-API] [PATCH 25 of 33] interface-reconfigure: Refactor the action_* methods, Ian Campbell
- [Xen-API] [PATCH 27 of 33] interface-reconfigure: Move bond and VLAN utilities to utility module, Ian Campbell
- [Xen-API] [PATCH 29 of 33] interface-reconfigure: Move ethtool and MTU setting utilities to module, Ian Campbell
- [Xen-API] [PATCH 28 of 33] interface-reconfigure: do not sort the result in pif_get_bond_slaves, Ian Campbell
- [Xen-API] [PATCH 26 of 33] interface-reconfigure: Move DatabaseCache object to utility module, Ian Campbell
|
|
|
|
|