ia64: nvram setup.

From: "Zhang, Xing Z" <xing.z.zhang@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kfraser@localhost.localdomain committed 2007-05-24 09:54:03 +01:00
1 parent 6b64aaa35a
commit d5cd127e3b
7 files changed
+275 -11

No files matched your search

+44 -4
View File
@@ -54,9 +54,9 @@ static PyObject *pyxc_error_to_exception(void)
return PyErr_SetFromErrno(xc_error_obj);
if ( err->message[0] != '\0' )
pyerr = Py_BuildValue("(iss)", err->code, desc, err->message);
pyerr = Py_BuildValue("(iss)", err->code, desc, err->message);
else
pyerr = Py_BuildValue("(is)", err->code, desc);
pyerr = Py_BuildValue("(is)", err->code, desc);
xc_clear_last_error();
@@ -163,6 +163,16 @@ static PyObject *pyxc_domain_unpause(XcObject *self, PyObject *args)
return dom_op(self, args, xc_domain_unpause);
}
static PyObject *pyxc_domain_destroy_hook(XcObject *self, PyObject *args)
{
#ifdef __ia64__
dom_op(self, args, xc_ia64_save_to_nvram);
#endif
Py_INCREF(zero);
return zero;
}
static PyObject *pyxc_domain_destroy(XcObject *self, PyObject *args)
{
return dom_op(self, args, xc_domain_destroy);
@@ -426,7 +436,7 @@ static PyObject *pyxc_linux_build(XcObject *self,
xc_dom_loginit();
if (!(dom = xc_dom_allocate(cmdline, features)))
return pyxc_error_to_exception();
return pyxc_error_to_exception();
if ( xc_dom_linux_build(self->xc_handle, dom, domid, mem_mb, image,
ramdisk, flags, store_evtchn, &store_mfn,
@@ -498,6 +508,23 @@ static PyObject *pyxc_get_hvm_param(XcObject *self,
}
#ifdef __ia64__
static PyObject *pyxc_nvram_init(XcObject *self,
PyObject *args)
{
char *dom_name;
uint32_t dom;
if ( !PyArg_ParseTuple(args, "si", &dom_name, &dom) )
return NULL;
xc_ia64_nvram_init(self->xc_handle, dom_name, dom);
Py_INCREF(zero);
return zero;
}
#endif /* __ia64__ */
static PyObject *pyxc_hvm_build(XcObject *self,
PyObject *args,
PyObject *kwds)
@@ -1156,6 +1183,13 @@ static PyMethodDef pyxc_methods[] = {
" dom [int]: Identifier of domain to be destroyed.\n\n"
"Returns: [int] 0 on success; -1 on error.\n" },
{ "domain_destroy_hook",
(PyCFunction)pyxc_domain_destroy_hook,
METH_VARARGS, "\n"
"Add a hook for arch stuff before destroy a domain.\n"
" dom [int]: Identifier of domain to be destroyed.\n\n"
"Returns: [int] 0 on success; -1 on error.\n" },
{ "domain_resume",
(PyCFunction)pyxc_domain_resume,
METH_VARARGS, "\n"
@@ -1397,7 +1431,13 @@ static PyMethodDef pyxc_methods[] = {
" dom [int]: Identifier of domain.\n"
" mem_kb [long]: .\n"
"Returns: [int] 0 on success; -1 on error.\n" },
#ifdef __ia64__
{ "nvram_init",
(PyCFunction)pyxc_nvram_init,
METH_VARARGS, "\n"
"Init nvram in IA64 platform\n"
"Returns: [int] 0 on success; -1 on error.\n" },
#endif /* __ia64__ */
{ "domain_ioport_permission",
(PyCFunction)pyxc_domain_ioport_permission,
METH_VARARGS | METH_KEYWORDS, "\n"
+1
View File
@@ -1666,6 +1666,7 @@ class XendDomainInfo:
self._cleanupVm()
if self.dompath is not None:
xc.domain_destroy_hook(self.domid)
self.destroyDomain()
self._cleanup_phantom_devs(paths)
+4
View File
@@ -469,6 +469,10 @@ class HVMImageHandler(ImageHandler):
class IA64_HVM_ImageHandler(HVMImageHandler):
def buildDomain(self):
xc.nvram_init(self.vm.getName(), self.vm.getDomid())
return HVMImageHandler.buildDomain(self)
def getRequiredAvailableMemory(self, mem_kb):
page_kb = 16
# ROM size for guest firmware, ioreq page, pio page and xenstore page
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.