]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commitdiff
xend: do not run a hotplug script from qemu on Linux
authorIan Campbell <ian.campbell@citrix.com>
Thu, 7 Jun 2012 17:45:22 +0000 (18:45 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 7 Jun 2012 17:45:22 +0000 (18:45 +0100)
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>
tools/python/xen/xend/image.py
tools/python/xen/xend/osdep.py

index e08417282dca92f15059e9cc041fb1e9eff7af31..832c16896bf0e52a4c1cb3af1633e34494c06e0c 100644 (file)
@@ -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")
index 3a09b5244c830a38f20d553a9504911778a0bb2e..b51dd2ee90fdf880aa0387daad78e6d298d318be 100644 (file)
@@ -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)