Package virtualization :: Module constants
[hide private]
[frames] | no frames]

Source Code for Module virtualization.constants

 1  # 
 2  # Copyright (c) 2008--2013 Red Hat, Inc. 
 3  # 
 4  # This software is licensed to you under the GNU General Public License, 
 5  # version 2 (GPLv2). There is NO WARRANTY for this software, express or 
 6  # implied, including the implied warranties of MERCHANTABILITY or FITNESS 
 7  # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 
 8  # along with this software; if not, see 
 9  # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 
10  # 
11  # Red Hat trademarks are not licensed under GPLv2. No permission is 
12  # granted to use or replicate Red Hat trademarks that are incorporated 
13  # in this software or its documentation. 
14  # 
15   
16  ############################################################################### 
17  # Constants 
18  ############################################################################### 
19   
20 -class StateType:
21 NOSTATE = 'nostate' 22 RUNNING = 'running' 23 BLOCKED = 'blocked' 24 PAUSED = 'paused' 25 SHUTDOWN = 'shutdown' 26 SHUTOFF = 'shutoff' 27 CRASHED = 'crashed'
28
29 -class VirtualizationType:
30 PARA = 'para_virtualized' 31 FULLY = 'fully_virtualized'
32
33 -class IdentityType:
34 HOST = 'host' 35 GUEST = 'guest'
36
37 -class PropertyType:
38 NAME = 'name' 39 UUID = 'uuid' 40 TYPE = 'virt_type' 41 MEMORY = 'memory_size' 42 VCPUS = 'vcpus' 43 STATE = 'state' 44 IDENTITY = 'identity' 45 ID = 'id' 46 MESSAGE = 'message'
47 48 ## 49 # This structure maps the libvirt state enumeration to labels that 50 # Red Hat Satellite understands. 51 # Reasons we don't care about differences between NOSTATE, RUNNING and BLOCKED: 52 # 1. technically, the domain is still "running" 53 # 2. RHN Classic / Red Hat Satellite / Spacewalk are not able to 54 # display 'blocked' & 'nostate' 55 # as valid states 56 # 3. to avoid 'Abuse of Service' messages: bugs #230106 and #546676 57 58 VIRT_STATE_NAME_MAP = ( StateType.RUNNING, # VIR_DOMAIN_NOSTATE 59 StateType.RUNNING, # VIR_DOMAIN_RUNNING 60 StateType.RUNNING, # VIR_DOMAIN_BLOCKED 61 StateType.PAUSED, # VIR_DOMAIN_PAUSED 62 StateType.SHUTDOWN, # VIR_DOMAIN_SHUTDOWN 63 StateType.SHUTOFF, # VIR_DOMAIN_SHUTOFF 64 StateType.CRASHED) # VIR_DOMAIN_CRASHED 65 66 VIRT_VDSM_STATUS_MAP = { 67 'Up' : 'running', 68 'Down': 'shutdown', 69 'Paused' : 'paused', 70 'Powering down' : 'shutoff', 71 } 72