|
|
|
|
|
|
|
|
|
|
xen-api
[Xen-API] [PATCH 04 of 12] [PATCH] xenserver: Hoist identical bridge and
# HG changeset patch
# User Ben Pfaff <blp@xxxxxxxxxx>
# Date 1278595551 -3600
# Node ID 28ddf8ad939a61b686e98d7d711af2ae9d4bbbe3
# Parent 50e349e5040adf945a97ebf2c6027b38cb2cc05c
[PATCH] xenserver: Hoist identical bridge and vswitch functions into common
code.
>From 96c7918c4043326bfa0e05b3fc9cbb9547279d40 Mon Sep 17 00:00:00 2001
Date: Tue, 23 Feb 2010 09:47:31 -0800
The previous commit made pif_bridge_name() in the bridge and vswitch
versions of interface-reconfigure functionally identical, so this commit
hoists them into a single common implementation in InterfaceReconfigure.py.
pif_is_bridged() also comes along for the ride because it is also generic
and because it is logically related. Only the bridge code uses it at the
moment.
Suggested-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ben Pfaff <blp@xxxxxxxxxx>
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
.../opt_xensource_libexec_InterfaceReconfigure.py | 28 ++++++++++++++++++++
...xensource_libexec_InterfaceReconfigureBridge.py | 28 --------------------
...ensource_libexec_InterfaceReconfigureVswitch.py | 16 -----------
3 files changed, 28 insertions(+), 44 deletions(-)
diff -r 50e349e5040a -r 28ddf8ad939a scripts/InterfaceReconfigure.py
--- a/scripts/InterfaceReconfigure.py Thu Jul 08 14:25:51 2010 +0100
+++ b/scripts/InterfaceReconfigure.py Thu Jul 08 14:25:51 2010 +0100
@@ -659,6 +659,34 @@
return pifrec['device']
#
+# Bridges
+#
+
+def pif_is_bridged(pif):
+ pifrec = db().get_pif_record(pif)
+ nwrec = db().get_network_record(pifrec['network'])
+
+ if nwrec['bridge']:
+ # TODO: sanity check that nwrec['bridgeless'] != 'true'
+ return True
+ else:
+ # TODO: sanity check that nwrec['bridgeless'] == 'true'
+ return False
+
+def pif_bridge_name(pif):
+ """Return the bridge name of a pif.
+
+ PIF must be a bridged PIF."""
+ pifrec = db().get_pif_record(pif)
+
+ nwrec = db().get_network_record(pifrec['network'])
+
+ if nwrec['bridge']:
+ return nwrec['bridge']
+ else:
+ raise Error("PIF %(uuid)s does not have a bridge name" % pifrec)
+
+#
# Bonded PIFs
#
def pif_is_bond(pif):
diff -r 50e349e5040a -r 28ddf8ad939a scripts/InterfaceReconfigureBridge.py
--- a/scripts/InterfaceReconfigureBridge.py Thu Jul 08 14:25:51 2010 +0100
+++ b/scripts/InterfaceReconfigureBridge.py Thu Jul 08 14:25:51 2010 +0100
@@ -136,34 +136,6 @@
__destroy_bond_device(name)
#
-# Bridges
-#
-
-def pif_is_bridged(pif):
- pifrec = db().get_pif_record(pif)
- nwrec = db().get_network_record(pifrec['network'])
-
- if nwrec['bridge']:
- # TODO: sanity check that nwrec['bridgeless'] != 'true'
- return True
- else:
- # TODO: sanity check that nwrec['bridgeless'] == 'true'
- return False
-
-def pif_bridge_name(pif):
- """Return the bridge name of a pif.
-
- PIF must be a bridged PIF."""
- pifrec = db().get_pif_record(pif)
-
- nwrec = db().get_network_record(pifrec['network'])
-
- if nwrec['bridge']:
- return nwrec['bridge']
- else:
- raise Error("PIF %(uuid)s does not have a bridge name" % pifrec)
-
-#
# Bring Interface up/down.
#
diff -r 50e349e5040a -r 28ddf8ad939a scripts/InterfaceReconfigureVswitch.py
--- a/scripts/InterfaceReconfigureVswitch.py Thu Jul 08 14:25:51 2010 +0100
+++ b/scripts/InterfaceReconfigureVswitch.py Thu Jul 08 14:25:51 2010 +0100
@@ -37,22 +37,6 @@
run_command(["/sbin/ifconfig", netdev, 'up'] + mtu)
#
-# Bridges
-#
-
-def pif_bridge_name(pif):
- """Return the bridge name of a pif.
-
- PIF must be a bridged PIF."""
-
- pifrec = db().get_pif_record(pif)
- nwrec = db().get_network_record(pifrec['network'])
- if nwrec['bridge']:
- return nwrec['bridge']
- else:
- raise Error("PIF %(uuid)s does not have a bridge name" % pifrec)
-
-#
# PIF miscellanea
#
scripts/InterfaceReconfigure.py | 28 ++++++++++++++++++++++++++++
scripts/InterfaceReconfigureBridge.py | 28 ----------------------------
scripts/InterfaceReconfigureVswitch.py | 16 ----------------
3 files changed, 28 insertions(+), 44 deletions(-)
txtDbrKbBqgHb.txt
Description: Text Data
_______________________________________________
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 00 of 12] first batch of openvswitch updates, David Scott
- [Xen-API] [PATCH 01 of 12] [PATCH] xenserver: Fix comment in interface-reconfigure, David Scott
- [Xen-API] [PATCH 02 of 12] [PATCH] xenserver: Delete ports by interface name, David Scott
- [Xen-API] [PATCH 03 of 12] [PATCH] xenserver: Accept VLAN PIFs in pif_bridge_name(), David Scott
- [Xen-API] [PATCH 05 of 12] [PATCH] xenserver: Fix bringing up VLAN PIFs, David Scott
- [Xen-API] [PATCH 04 of 12] [PATCH] xenserver: Hoist identical bridge and vswitch functions into common code,
David Scott <=
- [Xen-API] [PATCH 06 of 12] [PATCH] xenserver: Always call ovs-vsctl in bring_down(), David Scott
- [Xen-API] [PATCH 08 of 12] [PATCH] xenserver: Avoid doing unneeded work in deconfigure_datapath(), David Scott
- [Xen-API] [PATCH 07 of 12] [PATCH] xenserver: Set xs-network-uuids for both datapath and VLAN bridges, David Scott
- [Xen-API] [PATCH 09 of 12] [PATCH] xenserver: Remove a VLAN's bridge when bringing down its PIF, David Scott
- [Xen-API] [PATCH 11 of 12] [PATCH] xenserver: Add --root-prefix feature to interface-reconfigure, David Scott
- [Xen-API] [PATCH 10 of 12] [PATCH] xenserver: Add assertion and additional comments to ovs-vsctl commands, David Scott
- [Xen-API] [PATCH 12 of 12] [PATCH] xenserver: Add --no-syslog feature to interface-reconfigure, David Scott
|
|
|
|
|