source: trunk/packages/xen-3.1/xen-3.1/tools/python/xen/xend/XendConstants.py @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 2.9 KB
Line 
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#============================================================================
17
18from xen.xend.XendAPIConstants import *
19
20#
21# Shutdown codes and reasons.
22#
23
24DOMAIN_POWEROFF = 0 
25DOMAIN_REBOOT   = 1
26DOMAIN_SUSPEND  = 2
27DOMAIN_CRASH    = 3
28DOMAIN_HALT     = 4
29
30DOMAIN_SHUTDOWN_REASONS = {
31    DOMAIN_POWEROFF: "poweroff",
32    DOMAIN_REBOOT  : "reboot",
33    DOMAIN_SUSPEND : "suspend",
34    DOMAIN_CRASH   : "crash",
35    DOMAIN_HALT    : "halt"
36}
37REVERSE_DOMAIN_SHUTDOWN_REASONS = \
38    dict([(y, x) for x, y in DOMAIN_SHUTDOWN_REASONS.items()])
39
40HVM_PARAM_CALLBACK_IRQ = 0
41HVM_PARAM_STORE_PFN    = 1
42HVM_PARAM_STORE_EVTCHN = 2
43HVM_PARAM_PAE_ENABLED  = 4
44HVM_PARAM_IOREQ_PFN    = 5
45HVM_PARAM_BUFIOREQ_PFN = 6
46
47restart_modes = [
48    "restart",
49    "destroy",
50    "preserve",
51    "rename-restart"
52    ]
53
54DOM_STATES = [
55    'halted',
56    'paused',
57    'running',
58    'suspended',
59    'shutdown',
60    'unknown',
61]
62
63DOM_STATE_HALTED = XEN_API_VM_POWER_STATE_HALTED
64DOM_STATE_PAUSED = XEN_API_VM_POWER_STATE_PAUSED
65DOM_STATE_RUNNING = XEN_API_VM_POWER_STATE_RUNNING
66DOM_STATE_SUSPENDED = XEN_API_VM_POWER_STATE_SUSPENDED
67DOM_STATE_SHUTDOWN = XEN_API_VM_POWER_STATE_SHUTTINGDOWN
68DOM_STATE_UNKNOWN = XEN_API_VM_POWER_STATE_UNKNOWN
69
70DOM_STATES_OLD = [
71    'running',
72    'blocked',
73    'paused',
74    'shutdown',
75    'crashed',
76    'dying'
77    ]
78
79STATE_DOM_OK       = 1
80STATE_DOM_SHUTDOWN = 2
81
82SHUTDOWN_TIMEOUT = 30.0
83
84ZOMBIE_PREFIX = 'Zombie-'
85
86"""Minimum time between domain restarts in seconds."""
87MINIMUM_RESTART_TIME = 20
88
89RESTART_IN_PROGRESS = 'xend/restart_in_progress'
90LAST_SHUTDOWN_REASON = 'xend/last_shutdown_reason'
91
92TRIGGER_NMI   = 0
93TRIGGER_RESET = 1
94TRIGGER_INIT  = 2
95
96TRIGGER_TYPE = {
97    "nmi"   : TRIGGER_NMI,
98    "reset" : TRIGGER_RESET,
99    "init"  : TRIGGER_INIT
100}
101
102#
103# Device migration stages (eg. XendDomainInfo, XendCheckpoint, server.tpmif)
104#
105
106DEV_MIGRATE_TEST  = 0
107DEV_MIGRATE_STEP1 = 1
108DEV_MIGRATE_STEP2 = 2
109DEV_MIGRATE_STEP3 = 3
110
111#
112# VTPM-related constants
113#
114
115VTPM_DELETE_SCRIPT = '/etc/xen/scripts/vtpm-delete'
116
117#
118# Xenstore Constants
119#
120
121XS_VMROOT = "/vm/"
122
Note: See TracBrowser for help on using the repository browser.