mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Added an VM_HVM_REQUIRED error code, and use it on VM.start.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
abc324d48f
commit
2cb49001bc
6 files changed
+37
-10
No files matched your search
@@ -1141,7 +1141,8 @@ void
|
||||
|
||||
\vspace{0.3cm}
|
||||
|
||||
\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
|
||||
\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}, {\tt
|
||||
VM\_HVM\_REQUIRED}
|
||||
|
||||
\vspace{0.6cm}
|
||||
\subsubsection{RPC name:~pause}
|
||||
@@ -13337,6 +13338,15 @@ expected and actual VM state at the time of the call.
|
||||
\begin{verbatim}VM_BAD_POWER_STATE(vm, expected, actual)\end{verbatim}
|
||||
\begin{center}\rule{10em}{0.1pt}\end{center}
|
||||
|
||||
\subsubsection{VM\_HVM\_REQUIRED}
|
||||
|
||||
HVM is required for this operation
|
||||
|
||||
\vspace{0.3cm}
|
||||
{\bf Signature:}
|
||||
\begin{verbatim}VM_HVM_REQUIRED(vm)\end{verbatim}
|
||||
\begin{center}\rule{10em}{0.1pt}\end{center}
|
||||
|
||||
|
||||
|
||||
\newpage
|
||||
|
||||
@@ -1465,10 +1465,13 @@ class XendAPI(object):
|
||||
start_paused = start_paused)
|
||||
|
||||
def VM_start(self, session, vm_ref, start_paused):
|
||||
return XendTask.log_progress(0, 100, do_vm_func,
|
||||
"domain_start", vm_ref,
|
||||
start_paused = start_paused)
|
||||
|
||||
try:
|
||||
return XendTask.log_progress(0, 100, do_vm_func,
|
||||
"domain_start", vm_ref,
|
||||
start_paused = start_paused)
|
||||
except HVMRequired, exn:
|
||||
return xen_api_error(['VM_HVM_REQUIRED', vm_ref])
|
||||
|
||||
def VM_suspend(self, session, vm_ref):
|
||||
return XendTask.log_progress(0, 100, do_vm_func,
|
||||
"domain_suspend", vm_ref)
|
||||
|
||||
@@ -1489,7 +1489,12 @@ class XendDomainInfo:
|
||||
self.info['start_time'] = time.time()
|
||||
|
||||
self._stateSet(DOM_STATE_RUNNING)
|
||||
except (RuntimeError, VmError), exn:
|
||||
except VmError, exn:
|
||||
log.exception("XendDomainInfo.initDomain: exception occurred")
|
||||
if self.image:
|
||||
self.image.cleanupBootloading()
|
||||
raise exn
|
||||
except RuntimeError, exn:
|
||||
log.exception("XendDomainInfo.initDomain: exception occurred")
|
||||
if self.image:
|
||||
self.image.cleanupBootloading()
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#============================================================================
|
||||
# Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
|
||||
# Copyright (c) 2006, 2007 XenSource Inc.
|
||||
#============================================================================
|
||||
|
||||
from xmlrpclib import Fault
|
||||
@@ -55,6 +56,12 @@ class VmError(XendError):
|
||||
"""Vm construction error."""
|
||||
pass
|
||||
|
||||
class HVMRequired(VmError):
|
||||
def __init__(self):
|
||||
XendError.__init__(self,
|
||||
'HVM guest support is unavailable: is VT/AMD-V '
|
||||
'supported by your CPU and enabled in your BIOS?')
|
||||
|
||||
|
||||
XEND_ERROR_AUTHENTICATION_FAILED = ('ELUSER', 'Authentication Failed')
|
||||
XEND_ERROR_SESSION_INVALID = ('EPERMDENIED', 'Session Invalid')
|
||||
|
||||
@@ -24,7 +24,7 @@ import signal
|
||||
|
||||
import xen.lowlevel.xc
|
||||
from xen.xend.XendConstants import REVERSE_DOMAIN_SHUTDOWN_REASONS
|
||||
from xen.xend.XendError import VmError, XendError
|
||||
from xen.xend.XendError import VmError, XendError, HVMRequired
|
||||
from xen.xend.XendLogging import log
|
||||
from xen.xend.XendOptions import instance as xenopts
|
||||
from xen.xend.server.netif import randomMAC
|
||||
@@ -274,8 +274,7 @@ class HVMImageHandler(ImageHandler):
|
||||
|
||||
info = xc.xeninfo()
|
||||
if 'hvm' not in info['xen_caps']:
|
||||
raise VmError("HVM guest support is unavailable: is VT/AMD-V "
|
||||
"supported by your CPU and enabled in your BIOS?")
|
||||
raise HVMRequired()
|
||||
|
||||
self.dmargs = self.parseDeviceModelArgs(vmConfig)
|
||||
self.device_model = vmConfig['platform'].get('device_model')
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Xen-xm 3.0\n"
|
||||
"PO-Revision-Date: 2007-02-20 15:22+0000\n"
|
||||
"PO-Revision-Date: 2007-03-10 23:17+0000\n"
|
||||
"Last-Translator: Ewan Mellor <ewan@xensource.com>\n"
|
||||
"Language-Team: xen-devel <xen-devel@lists.xensource.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -61,3 +61,6 @@ msgstr "The VLAN tag you gave (%(1)s) is invalid -- it must be between 0 and 409
|
||||
|
||||
msgid "VM_BAD_POWER_STATE"
|
||||
msgstr "The VM must be %(2)s to perform the requested operation (it is currently %(3)s)."
|
||||
|
||||
msgid "VM_HVM_REQUIRED"
|
||||
msgstr "HVM guest support is unavailable: is VT/AMD-V supported by your CPU and enabled in your BIOS?"
|
||||