[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: Make hotplug script timeouts configurable



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1242695928 -3600
# Node ID 62ec6aae4ba9decb58dee6bfecd3e3e8b434cffa
# Parent  61501fa86b1b6bd5fc5b291200ac6f9048503ecb
xend: Make hotplug script timeouts configurable

In some configurations, when dom0 is busy with I/O, it may take
several minutes to complete all hotplug scripts required when a new
domain is being created. As device create timeout is set to 100
seconds, users get "hotplug scripts not working" error instead of a
new domain.

This patch makes both DEVICE_CREATE_TIMEOUT and DEVICE_DESTROY_TIMEOUT
configurable in xend-config.sxp to allow users to easily adapt hotplug
timeouts to their environment.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 docs/man/xend-config.sxp.pod.5               |   10 ++++++++++
 tools/examples/xend-config.sxp               |    6 ++++++
 tools/python/xen/xend/XendOptions.py         |   14 ++++++++++++++
 tools/python/xen/xend/server/DevConstants.py |    8 ++++++--
 4 files changed, 36 insertions(+), 2 deletions(-)

diff -r 61501fa86b1b -r 62ec6aae4ba9 docs/man/xend-config.sxp.pod.5
--- a/docs/man/xend-config.sxp.pod.5    Tue May 19 02:16:37 2009 +0100
+++ b/docs/man/xend-config.sxp.pod.5    Tue May 19 02:18:48 2009 +0100
@@ -115,6 +115,16 @@ migration, such as for example virtual T
 migration, such as for example virtual TPM migration. An example
 script is I</etc/xen/scripts/external-device-migrate>.
 
+=item I<device-create-timeout>
+
+Integer value that tells xend how long it should wait for a new device
+to be created. Defaults to I<100>.
+
+=item I<device-destroy-timeout>
+
+Integer value that tells xend how long it should wait for a device to
+be destroyed. Defaults to I<100>.
+
 =back
 
 =head1 EXAMPLES
diff -r 61501fa86b1b -r 62ec6aae4ba9 tools/examples/xend-config.sxp
--- a/tools/examples/xend-config.sxp    Tue May 19 02:16:37 2009 +0100
+++ b/tools/examples/xend-config.sxp    Tue May 19 02:18:48 2009 +0100
@@ -254,3 +254,9 @@
 # Path where persistent domain configuration is stored.
 # Default is /var/lib/xend/domains/
 #(xend-domains-path /var/lib/xend/domains)
+
+# Number of seconds xend will wait for device creation and
+# destruction
+#(device-create-timeout 100)
+#(device-destroy-timeout 100)
+
diff -r 61501fa86b1b -r 62ec6aae4ba9 tools/python/xen/xend/XendOptions.py
--- a/tools/python/xen/xend/XendOptions.py      Tue May 19 02:16:37 2009 +0100
+++ b/tools/python/xen/xend/XendOptions.py      Tue May 19 02:18:48 2009 +0100
@@ -141,6 +141,12 @@ class XendOptions:
     """Default rotation count of qemu-dm log file."""
     qemu_dm_logrotate_count = 10
 
+    """Default timeout for device creation."""
+    device_create_timeout_default = 100
+
+    """Default timeout for device destruction."""
+    device_destroy_timeout_default = 100
+
     def __init__(self):
         self.configure()
 
@@ -367,6 +373,14 @@ class XendOptions:
     def get_qemu_dm_logrotate_count(self):
         return self.get_config_int("qemu-dm-logrotate-count",
                                    self.qemu_dm_logrotate_count)
+
+    def get_device_create_timeout(self):
+        return self.get_config_int("device-create-timeout",
+                                   self.device_create_timeout_default)
+
+    def get_device_destroy_timeout(self):
+        return self.get_config_int("device-destroy-timeout",
+                                   self.device_destroy_timeout_default)
 
 
 class XendOptionsFile(XendOptions):
diff -r 61501fa86b1b -r 62ec6aae4ba9 
tools/python/xen/xend/server/DevConstants.py
--- a/tools/python/xen/xend/server/DevConstants.py      Tue May 19 02:16:37 
2009 +0100
+++ b/tools/python/xen/xend/server/DevConstants.py      Tue May 19 02:18:48 
2009 +0100
@@ -16,8 +16,12 @@
 # Copyright (C) 2005 XenSource Ltd
 #============================================================================
 
-DEVICE_CREATE_TIMEOUT  = 100
-DEVICE_DESTROY_TIMEOUT = 100
+from xen.xend import XendOptions
+
+xoptions = XendOptions.instance()
+
+DEVICE_CREATE_TIMEOUT  = xoptions.get_device_create_timeout();
+DEVICE_DESTROY_TIMEOUT = xoptions.get_device_destroy_timeout();
 HOTPLUG_STATUS_NODE = "hotplug-status"
 HOTPLUG_ERROR_NODE  = "hotplug-error"
 HOTPLUG_STATUS_ERROR = "error"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.