mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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@redhat.com>
This commit is contained in:
1 parent
9125594e4e
commit
41af6f38d9
4 files changed
+36
-2
No files matched your search
@@ -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()
|
||||
|
||||
@@ -368,6 +374,14 @@ class XendOptions:
|
||||
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):
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||