Improve their reliability by allowing socat to reuse an address,
preventing errors if migrations are executed with too narrow a
timespan.

Improve performance by choosing a better blocksize than the default 8k.

Signed-off-by: Hrvoje Ribicic <[email protected]>
---
 lib/hypervisor/hv_xen.py | 4 ++--
 src/Ganeti/Constants.hs  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/hypervisor/hv_xen.py b/lib/hypervisor/hv_xen.py
index 4229ba4..440ab96 100644
--- a/lib/hypervisor/hv_xen.py
+++ b/lib/hypervisor/hv_xen.py
@@ -1179,8 +1179,8 @@ class XenHypervisor(hv_base.BaseHypervisor):
       # And try and kill a previous daemon
       XenHypervisor._KillMigrationDaemon(instance)
 
-      listening_arg = "TCP-LISTEN:%d,bind=%s" % (port, target)
-      socat_pid = utils.StartDaemon(["socat", listening_arg,
+      listening_arg = "TCP-LISTEN:%d,bind=%s,reuseaddr" % (port, target)
+      socat_pid = utils.StartDaemon(["socat", "-b524288", listening_arg,
                                      "SYSTEM:'xl migrate-receive'"],
                                      pidfile=pidfile)
 
diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs
index 4c226e9..193dc26 100644
--- a/src/Ganeti/Constants.hs
+++ b/src/Ganeti/Constants.hs
@@ -505,7 +505,7 @@ xenKernel :: String
 xenKernel = AutoConf.xenKernel
 
 xlSocatCmd :: String
-xlSocatCmd = "socat - tcp:%s:%d #"
+xlSocatCmd = "socat -b524288 - TCP:%s:%d #"
 
 xlMigrationPidfile :: String
 xlMigrationPidfile = "socat.pid"
-- 
2.6.0.rc0.131.gf624c3d

Reply via email to