direct-io.hg

view tools/python/xen/xend/XendError.py @ 14342:e5d7b878118f

Added an VM_HVM_REQUIRED error code, and use it on VM.start.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Sat Mar 10 23:22:00 2007 +0000 (2007-03-10)
parents 5e1c7022d4ad
children 1786112d2430
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) 2004, 2005 Mike Wray <mike.wray@hp.com>
16 # Copyright (c) 2006, 2007 XenSource Inc.
17 #============================================================================
19 from xmlrpclib import Fault
21 import XendClient
23 class XendInvalidDomain(Fault):
24 def __init__(self, value):
25 Fault.__init__(self, XendClient.ERROR_INVALID_DOMAIN, value)
27 class XendError(Fault):
29 def __init__(self, value):
30 Fault.__init__(self, XendClient.ERROR_GENERIC, value)
31 self.value = value
33 def __str__(self):
34 return self.value
36 class VMBadState(XendError):
37 def __init__(self, value, expected, actual):
38 XendError.__init__(self, value)
39 self.expected = expected
40 self.actual = actual
42 class NetworkAlreadyConnected(XendError):
43 def __init__(self, pif_uuid):
44 XendError.__init__(self, 'Network already connected')
45 self.pif_uuid = pif_uuid
47 class PIFIsPhysical(XendError):
48 def __init__(self):
49 XendError.__init__(self, 'PIF is physical')
51 class VLANTagInvalid(XendError):
52 def __init__(self):
53 XendError.__init__(self, 'VLAN tag invalid')
55 class VmError(XendError):
56 """Vm construction error."""
57 pass
59 class HVMRequired(VmError):
60 def __init__(self):
61 XendError.__init__(self,
62 'HVM guest support is unavailable: is VT/AMD-V '
63 'supported by your CPU and enabled in your BIOS?')
66 XEND_ERROR_AUTHENTICATION_FAILED = ('ELUSER', 'Authentication Failed')
67 XEND_ERROR_SESSION_INVALID = ('EPERMDENIED', 'Session Invalid')
68 XEND_ERROR_DOMAIN_INVALID = ('EINVALIDDOMAIN', 'Domain Invalid')
69 XEND_ERROR_HOST_INVALID = ('EINVALIDHOST', 'Host Invalid')
70 XEND_ERROR_HOST_RUNNING = ('EHOSTRUNNING', 'Host is still Running')
71 XEND_ERROR_HOST_CPU_INVALID = ('EHOSTCPUINVALID', 'Host CPU Invalid')
72 XEND_ERROR_UNSUPPORTED = ('EUNSUPPORTED', 'Method Unsupported')
73 XEND_ERROR_VM_INVALID = ('EVMINVALID', 'VM Invalid')
74 XEND_ERROR_VBD_INVALID = ('EVBDINVALID', 'VBD Invalid')
75 XEND_ERROR_VIF_INVALID = ('EVIFINVALID', 'VIF Invalid')
76 XEND_ERROR_VTPM_INVALID = ('EVTPMINVALID', 'VTPM Invalid')
77 XEND_ERROR_VDI_INVALID = ('EVDIINVALID', 'VDI Invalid')
78 XEND_ERROR_SR_INVALID = ('ESRINVALID', 'SR Invalid')
79 XEND_ERROR_TODO = ('ETODO', 'Lazy Programmer Error')