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 24 of 33] interface-reconfigure: do not require a PIF f

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 24 of 33] interface-reconfigure: do not require a PIF for rewrite action
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 18 Dec 2009 14:17:19 +0000
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Fri, 18 Dec 2009 06:21:52 -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
Rewrite only needs to write a new /var/xapi/network.dbcache and this
contains all PIFs so passing a specific PIF is unnecessary.

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

diff -r d680275b3054 -r bd764843637e scripts/init.d-management-interface
--- a/scripts/init.d-management-interface       Fri Dec 18 14:16:32 2009 +0000
+++ b/scripts/init.d-management-interface       Fri Dec 18 14:16:32 2009 +0000
@@ -35,13 +35,9 @@
 }
 
 stop() {
-    [ -n "${INSTALLATION_UUID}" ] || return 0
-    echo -n 
     rm -f /var/lock/subsys/management-interface
-    PIF=$(xe pif-list host-uuid="${INSTALLATION_UUID}" management=true 
--minimal)
-    [ -n "${PIF}" ] || return 0
-    action $"Storing management interface configuration: " \
-       ${INTERFACE_RECONFIGURE} --pif-uuid "${PIF}" --management 
rewrite-configuration
+    action $"Storing network configuration: " \
+       ${INTERFACE_RECONFIGURE} rewrite
 }
 
 restart() {
diff -r d680275b3054 -r bd764843637e 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
@@ -16,7 +16,7 @@
 
     %(command-name)s <PIF> up
     %(command-name)s <PIF> down
-    %(command-name)s [<PIF>] rewrite
+    %(command-name)s rewrite
     %(command-name)s --force <BRIDGE> up
     %(command-name)s --force <BRIDGE> down
     %(command-name)s --force <BRIDGE> rewrite --device=<INTERFACE> 
--mac=<MAC-ADDRESS> <CONFIG>
@@ -1561,21 +1561,6 @@
     if dp:
         bring_down_interface(dp, destroy=True)
 
-def action_rewrite(pif):
-    dp = pif_datapath(pif)
-    f = ipdev_configure_network(pif)
-    if dp:
-        pf = configure_pif(dp)
-        f.attach_child(pf)
-    f.close()
-    try:
-        f.apply()
-        f.commit()
-    except Error, e:
-        log("failed to apply changes: %s" % e.msg)
-        f.revert()
-        raise
-
 # This is useful for reconfiguring the mgmt interface after having lost 
connectivity to the pool master
 def action_force_rewrite(bridge, config):
     def getUUID():
@@ -1745,7 +1730,9 @@
             raise Usage("--force is mutually exclusive with --session, --pif 
and --pif-uuid")
         if len(force_rewrite_config) and not (force_interface and action == 
"rewrite"):
             raise Usage("\"--force rewrite\" needed for --device, --mode, 
--ip, --netmask, and --gateway")
-
+        if (action == "rewrite") and (pif or pif_uuid ):
+            raise Usage("rewrite action does not take --pif or --pif-uuid")
+        
         global db
         if force_interface:
             log("Force interface %s %s" % (force_interface, action))
@@ -1769,7 +1756,7 @@
             if pif_uuid:
                 pif = db.get_pif_by_uuid(pif_uuid)
 
-            if action == "rewrite" and not pif:
+            if action == "rewrite":
                 pass
             else:
                 if not pif:
@@ -1793,8 +1780,6 @@
                     action_up(pif, False)
                 elif action == "down":
                     action_down(pif)
-                elif action == "rewrite":
-                    action_rewrite(pif)
                 else:
                     raise Error("Unknown action %s"  % action)
 

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

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