diff --git a/tools/python/xen/xend/Vifctl.py b/tools/python/xen/xend/Vifctl.py index 382cba5c04..9320930b27 100644 --- a/tools/python/xen/xend/Vifctl.py +++ b/tools/python/xen/xend/Vifctl.py @@ -32,4 +32,5 @@ def network(op): 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 --git a/tools/python/xen/xend/XendRoot.py b/tools/python/xen/xend/XendRoot.py index b51046a87b..564bc75ed3 100644 --- a/tools/python/xen/xend/XendRoot.py +++ b/tools/python/xen/xend/XendRoot.py @@ -114,7 +114,7 @@ class XendRoot: """ 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 @@ class XendRoot: config = sxp.parse(fin) finally: fin.close() - 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,7 +253,9 @@ class XendRoot: 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 else: return None @@ -258,9 +263,6 @@ class XendRoot: 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')