- Upstream patches from Jan
23233-hvm-cr-access.patch 23234-svm-decode-assist-base.patch 23235-svm-decode-assist-crs.patch 23236-svm-decode-assist-invlpg.patch 23238-svm-decode-assist-insn-fetch.patch 23303-cpufreq-misc.patch 23304-amd-oprofile-strings.patch 23305-amd-fam15-xenoprof.patch 23306-amd-fam15-vpmu.patch 23334-amd-fam12+14-vpmu.patch 23338-vtd-force-intremap.patch - fate#310957 - Update to Xen 4.1.1-rc1 c/s 23064 - xentrace: dynamic tracebuffer allocation xen-unstable.xentrace.dynamic_tbuf.patch xen-unstable.xentrace.empty_t_info_pages.patch xen-unstable.xentrace.verbose.patch xen-unstable.xentrace.no_gdprintk.patch xen-unstable.xentrace.comments.patch xen-unstable.xentrace.printk_prefix.patch xen-unstable.xentrace.remove_debug_printk.patch xen-unstable.xentrace.t_info_pages-formula.patch xen-unstable.xentrace.register_cpu_notifier-boot_time.patch xen-unstable.xentrace.t_info_page-overflow.patch xen-unstable.xentrace.t_info_first_offset.patch xen-unstable.xentrace.data_size__read_mostly.patch xen-unstable.xentrace.__insert_record-dst-type.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=124
This commit is contained in:
committed by
Git OBS Bridge
parent
ef397cbc2b
commit
8547e28bd5
@@ -1,14 +1,21 @@
|
||||
Subject: xenpaging: start xenpaging via config option
|
||||
xenpaging: start xenpaging via config option
|
||||
|
||||
Start xenpaging via config option.
|
||||
|
||||
TODO: add config option for pagefile directory
|
||||
TODO: add libxl support
|
||||
TODO: parse config values like 42K, 42M, 42G, 42%
|
||||
|
||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||
|
||||
---
|
||||
v4:
|
||||
add config option for pagefile directory
|
||||
add config option to enable debug
|
||||
add config option to set polic mru_size
|
||||
fail if chdir fails
|
||||
force self.xenpaging* variables to be strings because a xm new may turn some
|
||||
of them into type int and later os.execve fails with a TypeError
|
||||
|
||||
v3:
|
||||
decouple create/destroycreateXenPaging from _create/_removeDevices
|
||||
init xenpaging variable to 0 if xenpaging is not in config file to
|
||||
@@ -18,80 +25,105 @@ v2:
|
||||
unlink logfile instead of truncating it.
|
||||
allows hardlinking for further inspection
|
||||
|
||||
tools/examples/xmexample.hvm | 3 +
|
||||
tools/python/README.XendConfig | 1
|
||||
tools/python/README.sxpcfg | 1
|
||||
tools/python/xen/xend/XendConfig.py | 3 +
|
||||
---
|
||||
tools/examples/xmexample.hvm | 12 ++++
|
||||
tools/python/README.XendConfig | 4 +
|
||||
tools/python/README.sxpcfg | 4 +
|
||||
tools/python/xen/xend/XendConfig.py | 12 ++++
|
||||
tools/python/xen/xend/XendDomainInfo.py | 12 ++++
|
||||
tools/python/xen/xend/image.py | 84 ++++++++++++++++++++++++++++++++
|
||||
tools/python/xen/xm/create.py | 5 +
|
||||
tools/python/xen/xm/xenapi_create.py | 1
|
||||
8 files changed, 110 insertions(+)
|
||||
tools/python/xen/xend/image.py | 87 ++++++++++++++++++++++++++++++++
|
||||
tools/python/xen/xm/create.py | 20 +++++++
|
||||
tools/python/xen/xm/xenapi_create.py | 4 +
|
||||
8 files changed, 155 insertions(+)
|
||||
|
||||
Index: xen-4.0.2-testing/tools/examples/xmexample.hvm
|
||||
Index: xen-4.1.1-testing/tools/examples/xmexample.hvm
|
||||
===================================================================
|
||||
--- xen-4.0.2-testing.orig/tools/examples/xmexample.hvm
|
||||
+++ xen-4.0.2-testing/tools/examples/xmexample.hvm
|
||||
@@ -127,6 +127,9 @@ disk = [ 'file:/var/lib/xen/images/disk.
|
||||
--- xen-4.1.1-testing.orig/tools/examples/xmexample.hvm
|
||||
+++ xen-4.1.1-testing/tools/examples/xmexample.hvm
|
||||
@@ -127,6 +127,18 @@ disk = [ 'file:/var/lib/xen/images/disk.
|
||||
# Device Model to be used
|
||||
device_model = 'qemu-dm'
|
||||
|
||||
+# xenpaging, number of pages
|
||||
+xenpaging = 42
|
||||
+# number of guest pages to page-out, or -1 for entire guest memory range
|
||||
+xenpaging=42
|
||||
+
|
||||
+# directory to store guest page file
|
||||
+#xenpaging_workdir="/var/lib/xen/xenpaging"
|
||||
+
|
||||
+# enable debug output in pager
|
||||
+#xenpaging_debug=0
|
||||
+
|
||||
+# number of paged-in pages to keep in memory
|
||||
+#xenpaging_policy_mru_size=1024
|
||||
+
|
||||
#-----------------------------------------------------------------------------
|
||||
# boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d)
|
||||
# default: hard disk, cd-rom, floppy
|
||||
Index: xen-4.0.2-testing/tools/python/README.XendConfig
|
||||
Index: xen-4.1.1-testing/tools/python/README.XendConfig
|
||||
===================================================================
|
||||
--- xen-4.0.2-testing.orig/tools/python/README.XendConfig
|
||||
+++ xen-4.0.2-testing/tools/python/README.XendConfig
|
||||
@@ -120,6 +120,7 @@ otherConfig
|
||||
--- xen-4.1.1-testing.orig/tools/python/README.XendConfig
|
||||
+++ xen-4.1.1-testing/tools/python/README.XendConfig
|
||||
@@ -120,6 +120,10 @@ otherConfig
|
||||
image.vncdisplay
|
||||
image.vncunused
|
||||
image.hvm.device_model
|
||||
+ image.hvm.xenpaging
|
||||
+ image.hvm.xenpaging_workdir
|
||||
+ image.hvm.xenpaging_debug
|
||||
+ image.hvm.xenpaging_policy_mru_size
|
||||
image.hvm.display
|
||||
image.hvm.xauthority
|
||||
image.hvm.vncconsole
|
||||
Index: xen-4.0.2-testing/tools/python/README.sxpcfg
|
||||
Index: xen-4.1.1-testing/tools/python/README.sxpcfg
|
||||
===================================================================
|
||||
--- xen-4.0.2-testing.orig/tools/python/README.sxpcfg
|
||||
+++ xen-4.0.2-testing/tools/python/README.sxpcfg
|
||||
@@ -51,6 +51,7 @@ image
|
||||
--- xen-4.1.1-testing.orig/tools/python/README.sxpcfg
|
||||
+++ xen-4.1.1-testing/tools/python/README.sxpcfg
|
||||
@@ -51,6 +51,10 @@ image
|
||||
- vncunused
|
||||
(HVM)
|
||||
- device_model
|
||||
+ - xenpaging
|
||||
+ - xenpaging_workdir
|
||||
+ - xenpaging_debug
|
||||
+ - xenpaging_policy_mru_size
|
||||
- display
|
||||
- xauthority
|
||||
- vncconsole
|
||||
Index: xen-4.0.2-testing/tools/python/xen/xend/XendConfig.py
|
||||
Index: xen-4.1.1-testing/tools/python/xen/xend/XendConfig.py
|
||||
===================================================================
|
||||
--- xen-4.0.2-testing.orig/tools/python/xen/xend/XendConfig.py
|
||||
+++ xen-4.0.2-testing/tools/python/xen/xend/XendConfig.py
|
||||
@@ -145,6 +145,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
|
||||
--- xen-4.1.1-testing.orig/tools/python/xen/xend/XendConfig.py
|
||||
+++ xen-4.1.1-testing/tools/python/xen/xend/XendConfig.py
|
||||
@@ -147,6 +147,10 @@ XENAPI_PLATFORM_CFG_TYPES = {
|
||||
'apic': int,
|
||||
'boot': str,
|
||||
'device_model': str,
|
||||
+ 'xenpaging': str,
|
||||
+ 'xenpaging_workdir': str,
|
||||
+ 'xenpaging_debug': str,
|
||||
+ 'xenpaging_policy_mru_size': str,
|
||||
'loader': str,
|
||||
'display' : str,
|
||||
'fda': str,
|
||||
@@ -508,6 +509,8 @@ class XendConfig(dict):
|
||||
@@ -514,6 +518,14 @@ class XendConfig(dict):
|
||||
self['platform']['nomigrate'] = 0
|
||||
|
||||
if self.is_hvm():
|
||||
+ if 'xenpaging' not in self['platform']:
|
||||
+ self['platform']['xenpaging'] = "0"
|
||||
+ if 'xenpaging_workdir' not in self['platform']:
|
||||
+ self['platform']['xenpaging_workdir'] = "/var/lib/xen/xenpaging"
|
||||
+ if 'xenpaging_debug' not in self['platform']:
|
||||
+ self['platform']['xenpaging_debug'] = "0"
|
||||
+ if 'xenpaging_policy_mru_size' not in self['platform']:
|
||||
+ self['platform']['xenpaging_policy_mru_size'] = "0"
|
||||
if 'timer_mode' not in self['platform']:
|
||||
self['platform']['timer_mode'] = 1
|
||||
if 'extid' in self['platform'] and int(self['platform']['extid']) == 1:
|
||||
Index: xen-4.0.2-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
Index: xen-4.1.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
===================================================================
|
||||
--- xen-4.0.2-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-4.0.2-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -2293,6 +2293,8 @@ class XendDomainInfo:
|
||||
--- xen-4.1.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-4.1.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -2277,6 +2277,8 @@ class XendDomainInfo:
|
||||
self.info['name_label'], self.domid, self.info['uuid'],
|
||||
new_name, new_uuid)
|
||||
self._unwatchVm()
|
||||
@@ -100,7 +132,7 @@ Index: xen-4.0.2-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
self._releaseDevices()
|
||||
# Remove existing vm node in xenstore
|
||||
self._removeVm()
|
||||
@@ -2954,6 +2956,9 @@ class XendDomainInfo:
|
||||
@@ -2948,6 +2950,9 @@ class XendDomainInfo:
|
||||
|
||||
self._createDevices()
|
||||
|
||||
@@ -110,7 +142,7 @@ Index: xen-4.0.2-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
self.image.cleanupTmpImages()
|
||||
|
||||
self.info['start_time'] = time.time()
|
||||
@@ -2978,6 +2983,8 @@ class XendDomainInfo:
|
||||
@@ -2972,6 +2977,8 @@ class XendDomainInfo:
|
||||
self.refresh_shutdown_lock.acquire()
|
||||
try:
|
||||
self.unwatchShutdown()
|
||||
@@ -119,7 +151,7 @@ Index: xen-4.0.2-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
self._releaseDevices()
|
||||
bootloader_tidy(self)
|
||||
|
||||
@@ -3062,6 +3069,7 @@ class XendDomainInfo:
|
||||
@@ -3056,6 +3063,7 @@ class XendDomainInfo:
|
||||
self.image = image.create(self, self.info)
|
||||
if self.image:
|
||||
self._createDevices(True)
|
||||
@@ -127,7 +159,7 @@ Index: xen-4.0.2-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
self._storeDomDetails()
|
||||
self._registerWatches()
|
||||
self.refreshShutdown()
|
||||
@@ -3202,6 +3210,8 @@ class XendDomainInfo:
|
||||
@@ -3196,6 +3204,8 @@ class XendDomainInfo:
|
||||
# could also fetch a parsed note from xenstore
|
||||
fast = self.info.get_notes().get('SUSPEND_CANCEL') and 1 or 0
|
||||
if not fast:
|
||||
@@ -136,7 +168,7 @@ Index: xen-4.0.2-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
self._releaseDevices()
|
||||
self.testDeviceComplete()
|
||||
self.testvifsComplete()
|
||||
@@ -3217,6 +3227,8 @@ class XendDomainInfo:
|
||||
@@ -3211,6 +3221,8 @@ class XendDomainInfo:
|
||||
self._storeDomDetails()
|
||||
|
||||
self._createDevices()
|
||||
@@ -145,30 +177,29 @@ Index: xen-4.0.2-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
log.debug("XendDomainInfo.resumeDomain: devices created")
|
||||
|
||||
xc.domain_resume(self.domid, fast)
|
||||
Index: xen-4.0.2-testing/tools/python/xen/xend/image.py
|
||||
Index: xen-4.1.1-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
|
||||
@@ -122,12 +122,14 @@ class ImageHandler:
|
||||
--- xen-4.1.1-testing.orig/tools/python/xen/xend/image.py
|
||||
+++ xen-4.1.1-testing/tools/python/xen/xend/image.py
|
||||
@@ -122,6 +122,11 @@ class ImageHandler:
|
||||
self.vm.permissionsVm("image/cmdline", { 'dom': self.vm.getDomid(), 'read': True } )
|
||||
|
||||
self.device_model = vmConfig['platform'].get('device_model')
|
||||
+ self.xenpaging = vmConfig['platform'].get('xenpaging')
|
||||
+ self.xenpaging = str(vmConfig['platform'].get('xenpaging'))
|
||||
+ self.xenpaging_workdir = str(vmConfig['platform'].get('xenpaging_workdir'))
|
||||
+ self.xenpaging_debug = str(vmConfig['platform'].get('xenpaging_debug'))
|
||||
+ self.xenpaging_policy_mru_size = str(vmConfig['platform'].get('xenpaging_policy_mru_size'))
|
||||
+ self.xenpaging_pid = None
|
||||
|
||||
self.display = vmConfig['platform'].get('display')
|
||||
self.xauthority = vmConfig['platform'].get('xauthority')
|
||||
self.vncconsole = int(vmConfig['platform'].get('vncconsole', 0))
|
||||
self.dmargs = self.parseDeviceModelArgs(vmConfig)
|
||||
self.pid = None
|
||||
+ self.xenpaging_pid = None
|
||||
rtc_timeoffset = int(vmConfig['platform'].get('rtc_timeoffset', 0))
|
||||
if int(vmConfig['platform'].get('localtime', 0)):
|
||||
if time.localtime(time.time())[8]:
|
||||
@@ -392,6 +394,88 @@ class ImageHandler:
|
||||
@@ -392,6 +397,88 @@ class ImageHandler:
|
||||
sentinel_fifos_inuse[sentinel_path_fifo] = 1
|
||||
self.sentinel_path_fifo = sentinel_path_fifo
|
||||
|
||||
+ def createXenPaging(self):
|
||||
+ if not self.vm.info.is_hvm():
|
||||
+ return
|
||||
+ if self.xenpaging == "0":
|
||||
+ return
|
||||
+ if self.xenpaging_pid:
|
||||
@@ -178,6 +209,10 @@ Index: xen-4.0.2-testing/tools/python/xen/xend/image.py
|
||||
+ args = args + ([ "%d" % self.vm.getDomid()])
|
||||
+ args = args + ([ "%s" % self.xenpaging])
|
||||
+ env = dict(os.environ)
|
||||
+ if not self.xenpaging_debug == "0":
|
||||
+ env['XENPAGING_DEBUG'] = self.xenpaging_debug
|
||||
+ if not self.xenpaging_policy_mru_size == "0":
|
||||
+ env['XENPAGING_POLICY_MRU_SIZE'] = self.xenpaging_policy_mru_size
|
||||
+ self.xenpaging_logfile = "/var/log/xen/xenpaging-%s.log" % str(self.vm.info['name_label'])
|
||||
+ logfile_mode = os.O_WRONLY|os.O_CREAT|os.O_APPEND|os.O_TRUNC
|
||||
+ null = os.open("/dev/null", os.O_RDONLY)
|
||||
@@ -191,25 +226,19 @@ Index: xen-4.0.2-testing/tools/python/xen/xend/image.py
|
||||
+ xenpaging_pid = os.fork()
|
||||
+ if xenpaging_pid == 0: #child
|
||||
+ try:
|
||||
+ xenpaging_dir = "/var/lib/xen/xenpaging"
|
||||
+ osdep.postfork(contract)
|
||||
+ os.dup2(null, 0)
|
||||
+ os.dup2(logfd, 1)
|
||||
+ os.dup2(logfd, 2)
|
||||
+ try:
|
||||
+ os.chdir(xenpaging_dir)
|
||||
+ except:
|
||||
+ log.warn("chdir %s failed" % xenpaging_dir)
|
||||
+ os.chdir(self.xenpaging_workdir)
|
||||
+ try:
|
||||
+ log.info("starting %s" % args)
|
||||
+ os.execve(xenpaging_bin, args, env)
|
||||
+ except Exception, e:
|
||||
+ print >>sys.stderr, (
|
||||
+ 'failed to execute xenpaging: %s: %s' %
|
||||
+ xenpaging_bin, utils.exception_string(e))
|
||||
+ log.warn('failed to execute xenpaging: %s' % utils.exception_string(e))
|
||||
+ os._exit(126)
|
||||
+ except Exception, e:
|
||||
+ log.warn("staring xenpaging in %s failed" % xenpaging_dir)
|
||||
+ except:
|
||||
+ log.warn("starting xenpaging in %s failed" % self.xenpaging_workdir)
|
||||
+ os._exit(127)
|
||||
+ else:
|
||||
+ osdep.postfork(contract, abandon=True)
|
||||
@@ -253,38 +282,56 @@ Index: xen-4.0.2-testing/tools/python/xen/xend/image.py
|
||||
def createDeviceModel(self, restore = False):
|
||||
if self.device_model is None:
|
||||
return
|
||||
Index: xen-4.0.2-testing/tools/python/xen/xm/create.py
|
||||
Index: xen-4.1.1-testing/tools/python/xen/xm/create.py
|
||||
===================================================================
|
||||
--- xen-4.0.2-testing.orig/tools/python/xen/xm/create.py
|
||||
+++ xen-4.0.2-testing/tools/python/xen/xm/create.py
|
||||
@@ -495,6 +495,10 @@ gopts.var('nfs_root', val="PATH",
|
||||
--- xen-4.1.1-testing.orig/tools/python/xen/xm/create.py
|
||||
+++ xen-4.1.1-testing/tools/python/xen/xm/create.py
|
||||
@@ -495,6 +495,22 @@ gopts.var('nfs_root', val="PATH",
|
||||
fn=set_value, default=None,
|
||||
use="Set the path of the root NFS directory.")
|
||||
|
||||
+gopts.var('xenpaging', val='NUM',
|
||||
+ fn=set_value, default='0',
|
||||
+ use="Number of pages to swap.")
|
||||
+
|
||||
+gopts.var('xenpaging_workdir', val='PATH',
|
||||
+ fn=set_value, default='/var/lib/xen/xenpaging',
|
||||
+ use="Number of pages to swap.")
|
||||
+
|
||||
+gopts.var('xenpaging_debug', val='NUM',
|
||||
+ fn=set_value, default='0',
|
||||
+ use="Number of pages to swap.")
|
||||
+
|
||||
+gopts.var('xenpaging_policy_mru_size', val='NUM',
|
||||
+ fn=set_value, default='0',
|
||||
+ use="Number of pages to swap.")
|
||||
+
|
||||
gopts.var('device_model', val='FILE',
|
||||
fn=set_value, default=None,
|
||||
use="Path to device model program.")
|
||||
@@ -1080,6 +1084,7 @@ def configure_hvm(config_image, vals):
|
||||
@@ -1080,6 +1096,10 @@ def configure_hvm(config_image, vals):
|
||||
args = [ 'acpi', 'apic',
|
||||
'boot',
|
||||
'cpuid', 'cpuid_check',
|
||||
+ 'xenpaging',
|
||||
+ 'xenpaging_workdir',
|
||||
+ 'xenpaging_debug',
|
||||
+ 'xenpaging_policy_mru_size',
|
||||
'device_model', 'display',
|
||||
'fda', 'fdb',
|
||||
'gfx_passthru', 'guest_os_type',
|
||||
Index: xen-4.0.2-testing/tools/python/xen/xm/xenapi_create.py
|
||||
Index: xen-4.1.1-testing/tools/python/xen/xm/xenapi_create.py
|
||||
===================================================================
|
||||
--- xen-4.0.2-testing.orig/tools/python/xen/xm/xenapi_create.py
|
||||
+++ xen-4.0.2-testing/tools/python/xen/xm/xenapi_create.py
|
||||
@@ -1085,6 +1085,7 @@ class sxp2xml:
|
||||
--- xen-4.1.1-testing.orig/tools/python/xen/xm/xenapi_create.py
|
||||
+++ xen-4.1.1-testing/tools/python/xen/xm/xenapi_create.py
|
||||
@@ -1085,6 +1085,10 @@ class sxp2xml:
|
||||
'acpi',
|
||||
'apic',
|
||||
'boot',
|
||||
+ 'xenpaging',
|
||||
+ 'xenpaging_workdir',
|
||||
+ 'xenpaging_debug',
|
||||
+ 'xenpaging_policy_mru_size',
|
||||
'device_model',
|
||||
'loader',
|
||||
'fda',
|
||||
|
Reference in New Issue
Block a user