WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 25 of 33] interface-reconfigure: Refactor the action_*

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 25 of 33] interface-reconfigure: Refactor the action_* methods
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 18 Dec 2009 14:17:20 +0000
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Fri, 18 Dec 2009 06:22:02 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1261145815@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
these are now structurally the same in both the bridge and vswitch
versions of interface reconfigure.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r bd764843637e -r adca5858776b 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
@@ -1498,6 +1498,8 @@
     ipdev = pif_ipdev_name(pif)
     dp = pif_datapath(pif)
 
+    log("action_up: %s" % ipdev)
+
     f = ipdev_configure_network(pif)
 
     if dp:
@@ -1508,8 +1510,10 @@
     
     pif_rename_physical_devices(pif)
 
+    # if we are not forcing the interface up then attempt to tear down
+    # any existing devices which might interfere with brinign this one
+    # up.
     if not force:
-        # if there is a bridge using this pif then bring it down
         ifdown(ipdev)
 
         # Bring down any VLAN masters so that we can reconfigure the slave.
@@ -1537,14 +1541,14 @@
 
         ifup(ipdev)
 
-        # Update /etc/issue (which contains the IP address of the management 
interface)
-        os.system("/sbin/update-issue")
-
         # Bring back any currently-attached VLAN masters (brought down above)
         for master in [v for v in pif_get_vlan_masters(pif) if 
db.get_pif_record(v)['currently_attached']]:
             name = pif_netdev_name(master)
             log("action_up: bring up %s" % (name))
             netdev_up(name)
+
+        # Update /etc/issue (which contains the IP address of the management 
interface)
+        os.system("/sbin/update-issue")
 
         f.commit()
     except Error, e:
@@ -1555,6 +1559,8 @@
 def action_down(pif):
     ipdev = pif_ipdev_name(pif)
     dp = pif_datapath(pif)
+
+    log("action_down: %s" % ipdev)
 
     ifdown(ipdev)
 

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

<Prev in Thread] Current Thread [Next in Thread>