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/
Home Products Support Community News


[Xen-changelog] Change the interface between XendRoot.get_network_script

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Change the interface between XendRoot.get_network_script and Vifctl so that a
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 30 Oct 2005 22:34:09 +0000
Delivery-date: Sun, 30 Oct 2005 22:32:13 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 9f44b2aa98f3b4e48485900c857bae7cbc335895
# Parent  03612b7f69d50b18e24e58b61dce45ffa467fab3
Change the interface between XendRoot.get_network_script and Vifctl so that a
list is passed rather than a single string.  This expands the config-file
interface so that parameters may be passed to the network scripts from the
config file.

Fix XendRoot._logError (missing asterisk before args parameter).

In XendRoot, allow an empty configuration file.  This makes it easier to unit
test code reliant on XendRoot.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 03612b7f69d5 -r 9f44b2aa98f3 tools/python/xen/xend/Vifctl.py
--- a/tools/python/xen/xend/Vifctl.py   Sun Oct 30 12:45:06 2005
+++ b/tools/python/xen/xend/Vifctl.py   Sun Oct 30 12:48:34 2005
@@ -32,4 +32,5 @@
         raise ValueError('Invalid operation: ' + op)
     script = XendRoot.instance().get_network_script()
     if script:
-        os.spawnl(os.P_WAIT, script, script, op)
+        script.insert(1, op)
+        os.spawnv(os.P_WAIT, script[0], script)
diff -r 03612b7f69d5 -r 9f44b2aa98f3 tools/python/xen/xend/XendRoot.py
--- a/tools/python/xen/xend/XendRoot.py Sun Oct 30 12:45:06 2005
+++ b/tools/python/xen/xend/XendRoot.py Sun Oct 30 12:48:34 2005
@@ -114,7 +114,7 @@
         return self.components.get(name)
-    def _logError(self, fmt, args):
+    def _logError(self, fmt, *args):
         """Logging function to log to stderr. We use this for XendRoot log
         messages because they may be logged before the logger has been
         configured.  Other components can safely use the logger.
@@ -144,7 +144,10 @@
                     config = sxp.parse(fin)
-                config.insert(0, 'xend-config')
+                if config is None:
+                    config = ['xend-config']
+                else:
+                    config.insert(0, 'xend-config')
                 self.config = config
             except Exception, ex:
                 self._logError('Reading config file %s: %s',
@@ -250,16 +253,15 @@
         s = self.get_config_value('network-script')
         if s:
-            return os.path.join(self.network_script_dir, s)
+            result = s.split(" ")
+            result[0] = os.path.join(self.network_script_dir, result[0])
+            return result
             return None
     def get_enable_dump(self):
         return self.get_config_bool('enable-dump', 'no')
-    def get_vif_bridge(self):
-        return self.get_config_value('vif-bridge', 'xenbr0')
     def get_vif_script(self):
         return self.get_config_value('vif-script', 'vif-bridge')

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Change the interface between XendRoot.get_network_script and Vifctl so that a, Xen patchbot -unstable <=