ia64/xen-unstable

view tools/python/xen/xend/XendConstants.py @ 16245:b5a2cbca3930

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>
author Keir Fraser <keir@xensource.com>
date Fri Oct 26 09:56:54 2007 +0100 (2007-10-26)
parents d77da4c174f7
children 666573856c59
line source
1 #============================================================================
2 # This library is free software; you can redistribute it and/or
3 # modify it under the terms of version 2.1 of the GNU Lesser General Public
4 # License as published by the Free Software Foundation.
5 #
6 # This library is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 # Lesser General Public License for more details.
10 #
11 # You should have received a copy of the GNU Lesser General Public
12 # License along with this library; if not, write to the Free Software
13 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14 #============================================================================
15 # Copyright (C) 2006 XenSource Ltd.
16 #============================================================================
18 from xen.xend.XendAPIConstants import *
20 #
21 # Shutdown codes and reasons.
22 #
24 DOMAIN_POWEROFF = 0
25 DOMAIN_REBOOT = 1
26 DOMAIN_SUSPEND = 2
27 DOMAIN_CRASH = 3
28 DOMAIN_HALT = 4
30 DOMAIN_SHUTDOWN_REASONS = {
31 DOMAIN_POWEROFF: "poweroff",
32 DOMAIN_REBOOT : "reboot",
33 DOMAIN_SUSPEND : "suspend",
34 DOMAIN_CRASH : "crash",
35 DOMAIN_HALT : "halt"
36 }
37 REVERSE_DOMAIN_SHUTDOWN_REASONS = \
38 dict([(y, x) for x, y in DOMAIN_SHUTDOWN_REASONS.items()])
40 HVM_PARAM_CALLBACK_IRQ = 0
41 HVM_PARAM_STORE_PFN = 1
42 HVM_PARAM_STORE_EVTCHN = 2
43 HVM_PARAM_PAE_ENABLED = 4
44 HVM_PARAM_IOREQ_PFN = 5
45 HVM_PARAM_BUFIOREQ_PFN = 6
46 HVM_PARAM_NVRAM_FD = 7
47 HVM_PARAM_VHPT_SIZE = 8
48 HVM_PARAM_BUFPIOREQ_PFN = 9
49 HVM_PARAM_TIMER_MODE = 10
51 restart_modes = [
52 "restart",
53 "destroy",
54 "preserve",
55 "rename-restart"
56 ]
58 DOM_STATES = [
59 'halted',
60 'paused',
61 'running',
62 'suspended',
63 'shutdown',
64 'unknown',
65 ]
67 DOM_STATE_HALTED = XEN_API_VM_POWER_STATE_HALTED
68 DOM_STATE_PAUSED = XEN_API_VM_POWER_STATE_PAUSED
69 DOM_STATE_RUNNING = XEN_API_VM_POWER_STATE_RUNNING
70 DOM_STATE_SUSPENDED = XEN_API_VM_POWER_STATE_SUSPENDED
71 DOM_STATE_SHUTDOWN = XEN_API_VM_POWER_STATE_SHUTTINGDOWN
72 DOM_STATE_UNKNOWN = XEN_API_VM_POWER_STATE_UNKNOWN
74 DOM_STATES_OLD = [
75 'running',
76 'blocked',
77 'paused',
78 'shutdown',
79 'crashed',
80 'dying'
81 ]
83 STATE_DOM_OK = 1
84 STATE_DOM_SHUTDOWN = 2
86 SHUTDOWN_TIMEOUT = (60.0 * 5)
88 ZOMBIE_PREFIX = 'Zombie-'
90 """Minimum time between domain restarts in seconds."""
91 MINIMUM_RESTART_TIME = 20
93 RESTART_IN_PROGRESS = 'xend/restart_in_progress'
94 LAST_SHUTDOWN_REASON = 'xend/last_shutdown_reason'
96 TRIGGER_NMI = 0
97 TRIGGER_RESET = 1
98 TRIGGER_INIT = 2
100 TRIGGER_TYPE = {
101 "nmi" : TRIGGER_NMI,
102 "reset" : TRIGGER_RESET,
103 "init" : TRIGGER_INIT
104 }
106 #
107 # Device migration stages (eg. XendDomainInfo, XendCheckpoint, server.tpmif)
108 #
110 DEV_MIGRATE_TEST = 0
111 DEV_MIGRATE_STEP1 = 1
112 DEV_MIGRATE_STEP2 = 2
113 DEV_MIGRATE_STEP3 = 3
115 #
116 # VTPM-related constants
117 #
119 VTPM_DELETE_SCRIPT = '/etc/xen/scripts/vtpm-delete'
121 #
122 # Xenstore Constants
123 #
125 XS_VMROOT = "/vm/"