xen/xenpaging.autostart_delay.patch
Charles Arnold 551c9a62bc - Update to Xen 4.0.2 rc2, changeset 21452
- Enable support for kernel decompression for gzip, bzip2, and LZMA 
  so that kernels compressed with any of these methods can be 
  launched. 

- update xenalyze, more 64bit fixes

- allocate xentrace buffer metadata based on requested tbuf_size
  xentrace.dynamic_sized_tbuf.patch

- fate#310510 - fix xenpaging
  xenpaging.runtime_mru_size.patch
  - specify policy mru size at runtime
  xenpaging.no_domain_id.patch
  - reduce memory usage in pager

- bnc#625394 - set vif mtu from bridge mtu if kernel supports it
  vif-bridge.mtu.patch

- fate#310510 - fix xenpaging
  xenpaging.autostart_delay.patch
  - decouple create/destroycreateXenPaging from _create/_removeDevices
  - change xenpaging variable from int to str
  - init xenpaging variable to 0 if xenpaging is not in config file
    to avoid string None coming from sxp file

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=97
2011-02-14 21:35:06 +00:00

86 lines
4.7 KiB
Diff

Subject: xenpaging: add dynamic startup delay for xenpaging
This is a debug helper. Since the xenpaging support is still fragile, run
xenpaging at different stages in the bootprocess. Different delays will trigger
more bugs. This implementation starts without delay for 5 reboots, then
increments the delay by 0.1 seconds It uses xenstore for presistant storage of
delay values
TODO: find the correct place to remove the xenstore directory when the guest is shutdown or crashed
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
tools/python/xen/xend/image.py | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
Index: xen-4.0.2-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-4.0.2-testing.orig/tools/python/xen/xend/image.py
+++ xen-4.0.2-testing/tools/python/xen/xend/image.py
@@ -123,6 +123,19 @@ class ImageHandler:
self.device_model = vmConfig['platform'].get('device_model')
self.xenpaging = vmConfig['platform'].get('xenpaging')
+ if self.xenpaging is not "0":
+ self.xenpaging_delay = xstransact.Read("/local/domain/0/xenpaging/%s/xenpaging_delay" % self.vm.info['name_label'])
+ if self.xenpaging_delay == None:
+ log.warn("XXX creating /local/domain/0/xenpaging/%s" % self.vm.info['name_label'])
+ xstransact.Mkdir("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'])
+ xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay', '0.0'))
+ xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay_inc', '0.1'))
+ xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay_use', '5'))
+ xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay_used', '0'))
+ self.xenpaging_delay = float(xstransact.Read("/local/domain/0/xenpaging/%s/xenpaging_delay" % self.vm.info['name_label']))
+ self.xenpaging_delay_inc = float(xstransact.Read("/local/domain/0/xenpaging/%s/xenpaging_delay_inc" % self.vm.info['name_label']))
+ self.xenpaging_delay_use = int(xstransact.Read("/local/domain/0/xenpaging/%s/xenpaging_delay_use" % self.vm.info['name_label']))
+ self.xenpaging_delay_used = int(xstransact.Read("/local/domain/0/xenpaging/%s/xenpaging_delay_used" % self.vm.info['name_label']))
self.display = vmConfig['platform'].get('display')
self.xauthority = vmConfig['platform'].get('xauthority')
@@ -399,6 +412,17 @@ class ImageHandler:
return
if self.xenpaging_pid:
return
+ if self.xenpaging_delay_used < self.xenpaging_delay_use:
+ self.xenpaging_delay_used += 1
+ else:
+ self.xenpaging_delay_used = 0
+ self.xenpaging_delay += self.xenpaging_delay_inc
+ log.info("delay_used %s" % self.xenpaging_delay_used)
+ log.info("delay_use %s" % self.xenpaging_delay_use)
+ log.info("delay %s" % self.xenpaging_delay)
+ log.info("delay_inc %s" % self.xenpaging_delay_inc)
+ xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay', self.xenpaging_delay))
+ xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay_used', self.xenpaging_delay_used))
xenpaging_bin = auxbin.pathTo("xenpaging")
args = [xenpaging_bin]
args = args + ([ "%d" % self.vm.getDomid()])
@@ -427,6 +451,9 @@ class ImageHandler:
except:
log.warn("chdir %s failed" % xenpaging_dir)
try:
+ if self.xenpaging_delay != 0.0:
+ log.info("delaying xenpaging startup %s seconds ..." % self.xenpaging_delay)
+ time.sleep(self.xenpaging_delay)
log.info("starting %s" % args)
os.execve(xenpaging_bin, args, env)
except Exception, e:
@@ -442,10 +469,16 @@ class ImageHandler:
self.xenpaging_pid = xenpaging_pid
os.close(null)
os.close(logfd)
+ if self.xenpaging_delay == 0.0:
+ log.warn("waiting for xenpaging ...")
+ time.sleep(22)
+ log.warn("waiting for xenpaging done.")
def destroyXenPaging(self):
if self.xenpaging == "0":
return
+ # FIXME find correct place for guest shutdown or crash
+ #xstransact.Remove("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'])
if self.xenpaging_pid:
try:
os.kill(self.xenpaging_pid, signal.SIGHUP)