ia64/xen-unstable

annotate tools/python/xen/xend/XendConstants.py @ 16182:d77da4c174f7

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