aboutsummaryrefslogtreecommitdiffstats
path: root/tools/python
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2012-06-07 18:45:22 +0100
committerIan Campbell <ian.campbell@citrix.com>2012-06-07 18:45:22 +0100
commit00a279eb5f4d8ae568f36de14892c3859d9cf682 (patch)
treea135b386b05140d9f5e9dceddc063c746807b1a0 /tools/python
parentdc8afb6c3213f74a9d103747f4ea0daa2b98c332 (diff)
downloadxen-00a279eb5f4d8ae568f36de14892c3859d9cf682.tar.gz
xen-00a279eb5f4d8ae568f36de14892c3859d9cf682.tar.bz2
xen-00a279eb5f4d8ae568f36de14892c3859d9cf682.zip
xend: do not run a hotplug script from qemu on Linux
The current vif-hotplug-common.sh for renaming the tap device is failing because it is racing with this script and therefore the device is unexpectedly up when we come to rename it. Fix this in the same way as libxl does, by disabling the script (only on Linux). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/python')
-rw-r--r--tools/python/xen/xend/image.py9
-rw-r--r--tools/python/xen/xend/osdep.py5
2 files changed, 12 insertions, 2 deletions
diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
index e08417282d..832c16896b 100644
--- a/tools/python/xen/xend/image.py
+++ b/tools/python/xen/xend/image.py
@@ -919,8 +919,13 @@ class HVMImageHandler(ImageHandler):
(nics, mac, model))
vifname = "vif%d.%d-emu" % (self.vm.getDomid(), nics-1)
ret.append("-net")
- ret.append("tap,vlan=%d,ifname=%s,bridge=%s" %
- (nics, vifname, bridge))
+ if osdep.tapif_script is not None:
+ script=",script=%s,downscript=%s" % \
+ (osdep.tapif_script, osdep.tapif_script)
+ else:
+ script=""
+ ret.append("tap,vlan=%d,ifname=%s,bridge=%s%s" %
+ (nics, vifname, bridge, script))
if nics == 0:
ret.append("-net")
diff --git a/tools/python/xen/xend/osdep.py b/tools/python/xen/xend/osdep.py
index 3a09b5244c..b51dd2ee90 100644
--- a/tools/python/xen/xend/osdep.py
+++ b/tools/python/xen/xend/osdep.py
@@ -30,6 +30,10 @@ _vif_script = {
"SunOS": "vif-vnic"
}
+_tapif_script = {
+ "Linux": "no",
+}
+
PROC_XEN_BALLOON = '/proc/xen/balloon'
SYSFS_XEN_MEMORY = '/sys/devices/system/xen_memory/xen_memory0'
@@ -257,6 +261,7 @@ def _get(var, default=None):
xend_autorestart = _get(_xend_autorestart)
vif_script = _get(_vif_script, "vif-bridge")
+tapif_script = _get(_tapif_script)
lookup_balloon_stat = _get(_balloon_stat, _linux_balloon_stat)
get_cpuinfo = _get(_get_cpuinfo, _linux_get_cpuinfo)
prefork = _get(_get_prefork, _default_prefork)