ia64/xen-unstable

view tools/python/xen/xend/XendConstants.py @ 19848:5839491bbf20

[IA64] replace MAX_VCPUS with d->max_vcpus where necessary.

don't use MAX_VCPUS, and use vcpu::max_vcpus.
The changeset of 2f9e1348aa98 introduced max_vcpus to allow more vcpus
per guest. This patch is ia64 counter part.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 11:26:05 2009 +0900 (2009-06-29)
parents f210a633571c
children
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 *
19 from xen.util import auxbin
21 #
22 # Shutdown codes and reasons.
23 #
25 DOMAIN_POWEROFF = 0
26 DOMAIN_REBOOT = 1
27 DOMAIN_SUSPEND = 2
28 DOMAIN_CRASH = 3
29 DOMAIN_HALT = 4
31 DOMAIN_SHUTDOWN_REASONS = {
32 DOMAIN_POWEROFF: "poweroff",
33 DOMAIN_REBOOT : "reboot",
34 DOMAIN_SUSPEND : "suspend",
35 DOMAIN_CRASH : "crash",
36 DOMAIN_HALT : "halt"
37 }
38 REVERSE_DOMAIN_SHUTDOWN_REASONS = \
39 dict([(y, x) for x, y in DOMAIN_SHUTDOWN_REASONS.items()])
41 HVM_PARAM_CALLBACK_IRQ = 0
42 HVM_PARAM_STORE_PFN = 1
43 HVM_PARAM_STORE_EVTCHN = 2
44 HVM_PARAM_PAE_ENABLED = 4
45 HVM_PARAM_IOREQ_PFN = 5
46 HVM_PARAM_BUFIOREQ_PFN = 6
47 HVM_PARAM_NVRAM_FD = 7 # ia64
48 HVM_PARAM_VHPT_SIZE = 8 # ia64
49 HVM_PARAM_BUFPIOREQ_PFN = 9 # ia64
50 HVM_PARAM_VIRIDIAN = 9 # x86
51 HVM_PARAM_TIMER_MODE = 10
52 HVM_PARAM_HPET_ENABLED = 11
53 HVM_PARAM_ACPI_S_STATE = 14
54 HVM_PARAM_VPT_ALIGN = 16
56 restart_modes = [
57 "restart",
58 "destroy",
59 "preserve",
60 "rename-restart",
61 "coredump-destroy",
62 "coredump-restart"
63 ]
65 DOM_STATES = [
66 'halted',
67 'paused',
68 'running',
69 'suspended',
70 'shutdown',
71 'crashed',
72 'unknown',
73 ]
75 DOM_STATE_HALTED = XEN_API_VM_POWER_STATE_HALTED
76 DOM_STATE_PAUSED = XEN_API_VM_POWER_STATE_PAUSED
77 DOM_STATE_RUNNING = XEN_API_VM_POWER_STATE_RUNNING
78 DOM_STATE_SUSPENDED = XEN_API_VM_POWER_STATE_SUSPENDED
79 DOM_STATE_SHUTDOWN = XEN_API_VM_POWER_STATE_SHUTTINGDOWN
80 DOM_STATE_CRASHED = XEN_API_VM_POWER_STATE_CRASHED
81 DOM_STATE_UNKNOWN = XEN_API_VM_POWER_STATE_UNKNOWN
83 DOM_STATES_OLD = [
84 'running',
85 'blocked',
86 'paused',
87 'shutdown',
88 'crashed',
89 'dying'
90 ]
92 STATE_DOM_OK = 1
93 STATE_DOM_SHUTDOWN = 2
95 SHUTDOWN_TIMEOUT = (60.0 * 5)
97 ZOMBIE_PREFIX = 'Zombie-'
99 """Minimum time between domain restarts in seconds."""
100 MINIMUM_RESTART_TIME = 60
102 RESTART_IN_PROGRESS = 'xend/restart_in_progress'
103 DUMPCORE_IN_PROGRESS = 'xend/dumpcore_in_progress'
104 LAST_SHUTDOWN_REASON = 'xend/last_shutdown_reason'
106 TRIGGER_NMI = 0
107 TRIGGER_RESET = 1
108 TRIGGER_INIT = 2
109 TRIGGER_POWER = 3
110 TRIGGER_S3RESUME = 4
112 TRIGGER_TYPE = {
113 "nmi" : TRIGGER_NMI,
114 "reset" : TRIGGER_RESET,
115 "init" : TRIGGER_INIT,
116 "s3resume": TRIGGER_S3RESUME,
117 "power": TRIGGER_POWER
118 }
120 #
121 # Device migration stages (eg. XendDomainInfo, XendCheckpoint, server.tpmif)
122 #
124 DEV_MIGRATE_TEST = 0
125 DEV_MIGRATE_STEP1 = 1
126 DEV_MIGRATE_STEP2 = 2
127 DEV_MIGRATE_STEP3 = 3
129 #
130 # VTPM-related constants
131 #
133 VTPM_DELETE_SCRIPT = auxbin.scripts_dir() + '/vtpm-delete'
135 #
136 # Xenstore Constants
137 #
139 XS_VMROOT = "/vm/"
141 NR_PCI_DEV = 32
142 AUTO_PHP_SLOT = NR_PCI_DEV
143 AUTO_PHP_SLOT_STR = "%02x" % NR_PCI_DEV
145 #
146 # tmem
147 #
149 TMEM_CONTROL = 0
150 TMEM_NEW_POOL = 1
151 TMEM_DESTROY_POOL = 2
152 TMEM_NEW_PAGE = 3
153 TMEM_PUT_PAGE = 4
154 TMEM_GET_PAGE = 5
155 TMEM_FLUSH_PAGE = 6
156 TMEM_FLUSH_OBJECT = 7
157 TMEM_READ = 8
158 TMEM_WRITE = 9
159 TMEM_XCHG = 10
161 TMEMC_THAW = 0
162 TMEMC_FREEZE = 1
163 TMEMC_FLUSH = 2
164 TMEMC_DESTROY = 3
165 TMEMC_LIST = 4
166 TMEMC_SET_WEIGHT = 5
167 TMEMC_SET_CAP = 6
168 TMEMC_SET_COMPRESS = 7