aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir@xensource.com>2007-10-26 09:56:54 +0100
committerKeir Fraser <keir@xensource.com>2007-10-26 09:56:54 +0100
commit617d4311ef314ca79bdabe1c1087e42eabba09b8 (patch)
tree32b331607ce6488ee0fea313d831109e7e5d4ebf /tools
parent5afede5ce640deb26e258c2d2c9dbbecef0fc0a5 (diff)
downloadxen-617d4311ef314ca79bdabe1c1087e42eabba09b8.tar.gz
xen-617d4311ef314ca79bdabe1c1087e42eabba09b8.tar.bz2
xen-617d4311ef314ca79bdabe1c1087e42eabba09b8.zip
hvm, x86: Allow virtual timer mode to be specified.
In HVM config file: timer_mode=0 # Default: virtual time is delayed when timer ticks are # missed dur to preemption timer_mode=1 # Virtual time always equals wall time, even while missed # ticks are pending From: Haitao Shan <haitao.shan@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/xend/XendConfig.py2
-rw-r--r--tools/python/xen/xend/XendConstants.py1
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py5
-rw-r--r--tools/python/xen/xm/create.py7
-rw-r--r--tools/python/xen/xm/xenapi_create.py2
5 files changed, 14 insertions, 3 deletions
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
index 54b29ddc23..9debec185e 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -127,7 +127,7 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 'boot', 'device_model', 'display',
'fda', 'fdb', 'keymap', 'isa', 'localtime', 'monitor',
'nographic', 'pae', 'rtc_timeoffset', 'serial', 'sdl',
'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
- 'vncconsole', 'vncdisplay', 'vnclisten',
+ 'vncconsole', 'vncdisplay', 'vnclisten', 'timer_mode',
'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt']
# Xen API console 'other_config' keys.
diff --git a/tools/python/xen/xend/XendConstants.py b/tools/python/xen/xend/XendConstants.py
index befabb4e16..ecf911c141 100644
--- a/tools/python/xen/xend/XendConstants.py
+++ b/tools/python/xen/xend/XendConstants.py
@@ -46,6 +46,7 @@ HVM_PARAM_BUFIOREQ_PFN = 6
HVM_PARAM_NVRAM_FD = 7
HVM_PARAM_VHPT_SIZE = 8
HVM_PARAM_BUFPIOREQ_PFN = 9
+HVM_PARAM_TIMER_MODE = 10
restart_modes = [
"restart",
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index d07926bb7d..d3a8623f6b 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -1596,6 +1596,11 @@ class XendDomainInfo:
self._recreateDom()
+ # Set timer configration of domain
+ if hvm:
+ xc.hvm_set_param(self.domid, HVM_PARAM_TIMER_MODE,
+ long(self.info["platform"].get("timer_mode")))
+
# Set maximum number of vcpus in domain
xc.domain_max_vcpus(self.domid, int(self.info['VCPUs_max']))
diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
index b9bd16258d..b90e29d286 100644
--- a/tools/python/xen/xm/create.py
+++ b/tools/python/xen/xm/create.py
@@ -194,6 +194,11 @@ gopts.var('pae', val='PAE',
fn=set_int, default=1,
use="Disable or enable PAE of HVM domain.")
+gopts.var('timer_mode', val='TIMER_MODE',
+ fn=set_int, default=0,
+ use="""Timer mode (0=delay virtual time when ticks are missed;
+ 1=virtual time is always wallclock time.""")
+
gopts.var('acpi', val='ACPI',
fn=set_int, default=1,
use="Disable or enable ACPI of HVM domain.")
@@ -724,7 +729,7 @@ def configure_vifs(config_devs, vals):
def configure_hvm(config_image, vals):
"""Create the config for HVM devices.
"""
- args = [ 'device_model', 'pae', 'vcpus', 'boot', 'fda', 'fdb',
+ args = [ 'device_model', 'pae', 'vcpus', 'boot', 'fda', 'fdb', 'timer_mode',
'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw',
'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten',
'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py
index 8140ca35c5..29ef6efb70 100644
--- a/tools/python/xen/xm/xenapi_create.py
+++ b/tools/python/xen/xm/xenapi_create.py
@@ -818,7 +818,7 @@ class sxp2xml:
def extract_platform(self, image, document):
- platform_keys = ['acpi', 'apic', 'pae', 'vhpt']
+ platform_keys = ['acpi', 'apic', 'pae', 'vhpt', 'timer_mode']
def extract_platform_key(key):
platform = document.createElement("platform")