ia64/xen-unstable

view tools/python/xen/xend/XendConstants.py @ 12725:36fe7ca48e54

Tidy up the creation of directories that Xend needs. This avoids potential
races in this creation.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Dec 01 11:32:32 2006 +0000 (2006-12-01)
parents cefb1f761f0b
children 5f86325c62f6
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 restart_modes = [
41 "restart",
42 "destroy",
43 "preserve",
44 "rename-restart"
45 ]
47 DOM_STATES = [
48 'halted',
49 'paused',
50 'running',
51 'suspended',
52 'shutdown',
53 'unknown',
54 ]
56 DOM_STATE_HALTED = XEN_API_VM_POWER_STATE_HALTED
57 DOM_STATE_PAUSED = XEN_API_VM_POWER_STATE_PAUSED
58 DOM_STATE_RUNNING = XEN_API_VM_POWER_STATE_RUNNING
59 DOM_STATE_SUSPENDED = XEN_API_VM_POWER_STATE_SUSPENDED
60 DOM_STATE_SHUTDOWN = XEN_API_VM_POWER_STATE_SHUTTINGDOWN
61 DOM_STATE_UNKNOWN = XEN_API_VM_POWER_STATE_UNKNOWN
63 DOM_STATES_OLD = [
64 'running',
65 'blocked',
66 'paused',
67 'shutdown',
68 'crashed',
69 'dying'
70 ]
72 STATE_DOM_OK = 1
73 STATE_DOM_SHUTDOWN = 2
75 SHUTDOWN_TIMEOUT = 30.0
77 ZOMBIE_PREFIX = 'Zombie-'
79 """Minimum time between domain restarts in seconds."""
80 MINIMUM_RESTART_TIME = 20
82 RESTART_IN_PROGRESS = 'xend/restart_in_progress'
84 #
85 # Device migration stages (eg. XendDomainInfo, XendCheckpoint, server.tpmif)
86 #
88 DEV_MIGRATE_TEST = 0
89 DEV_MIGRATE_STEP1 = 1
90 DEV_MIGRATE_STEP2 = 2
91 DEV_MIGRATE_STEP3 = 3
93 #
94 # VTPM-related constants
95 #
97 VTPM_DELETE_SCRIPT = '/etc/xen/scripts/vtpm-delete'
99 #
100 # Xenstore Constants
101 #
103 XS_VMROOT = "/vm/"