[HVM] Save/restore: PV-on-HVM driver save/restore support

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
This commit is contained in:
Tim Deegan committed 2007-03-29 16:27:52 +00:00
1 parent 56ada11259
commit 9dd742c907
6 files changed
+93 -8

No files matched your search

+28
View File
@@ -467,6 +467,26 @@ static PyObject *pyxc_linux_build(XcObject *self,
return pyxc_error_to_exception();
}
static PyObject *pyxc_get_hvm_param(XcObject *self,
PyObject *args,
PyObject *kwds)
{
uint32_t dom;
int param;
unsigned long value;
static char *kwd_list[] = { "domid", "param", NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwd_list,
&dom, &param) )
return NULL;
if ( xc_get_hvm_param(self->xc_handle, dom, param, &value) != 0 )
return pyxc_error_to_exception();
return Py_BuildValue("i", value);
}
static PyObject *pyxc_hvm_build(XcObject *self,
PyObject *args,
PyObject *kwds)
@@ -1225,6 +1245,14 @@ static PyMethodDef pyxc_methods[] = {
" vcpus [int, 1]: Number of Virtual CPUS in domain.\n\n"
"Returns: [int] 0 on success; -1 on error.\n" },
{ "hvm_get_param",
(PyCFunction)pyxc_get_hvm_param,
METH_VARARGS | METH_KEYWORDS, "\n"
"get a parameter of HVM guest OS.\n"
" dom [int]: Identifier of domain to build into.\n"
" param [int]: No. of HVM param.\n"
"Returns: [int] value of the param.\n" },
{ "sched_id_get",
(PyCFunction)pyxc_sched_id_get,
METH_NOARGS, "\n"
+7
View File
@@ -37,6 +37,13 @@ DOMAIN_SHUTDOWN_REASONS = {
REVERSE_DOMAIN_SHUTDOWN_REASONS = \
dict([(y, x) for x, y in DOMAIN_SHUTDOWN_REASONS.items()])
HVM_PARAM_CALLBACK_IRQ = 0
HVM_PARAM_STORE_PFN = 1
HVM_PARAM_STORE_EVTCHN = 2
HVM_PARAM_PAE_ENABLED = 4
HVM_PARAM_IOREQ_PFN = 5
HVM_PARAM_BUFIOREQ_PFN = 6
restart_modes = [
"restart",
"destroy",
+6 -5
View File
@@ -448,11 +448,12 @@ class XendDomainInfo:
self._removeVm('xend/previous_restart_time')
self.storeDom("control/shutdown", reason)
## shutdown hypercall for hvm domain desides xenstore write
if self.info.is_hvm():
for code in DOMAIN_SHUTDOWN_REASONS.keys():
if DOMAIN_SHUTDOWN_REASONS[code] == reason:
break
## HVM domain shutdown itself if has PV driver,
## otherwise remote shutdown it
hvm_pvdrv = xc.hvm_get_param(self.domid, HVM_PARAM_CALLBACK_IRQ)
if self.info.is_hvm() and not hvm_pvdrv:
code = REVERSE_DOMAIN_SHUTDOWN_REASONS[reason]
log.info("HVM save:remote shutdown dom %d!", self.domid)
xc.domain_shutdown(self.domid, code)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.