[TOOLS] Fix the build. Clearly demarcate PPC-specific stuff.

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kfraser@localhost.localdomain committed 2006-12-13 10:23:53 +00:00
1 parent 495b9df077
commit 15e8ea54ac
4 files changed
+97 -98

No files matched your search

+83 -85
View File
@@ -386,47 +386,6 @@ static PyObject *pyxc_linux_build(XcObject *self,
"console_mfn", console_mfn);
}
static PyObject *pyxc_prose_build(XcObject *self,
PyObject *args,
PyObject *kwds)
{
uint32_t dom;
char *image, *ramdisk = NULL, *cmdline = "", *features = NULL;
int flags = 0;
int store_evtchn, console_evtchn;
unsigned long store_mfn = 0;
unsigned long console_mfn = 0;
void *arch_args = NULL;
int unused;
static char *kwd_list[] = { "dom", "store_evtchn",
"console_evtchn", "image",
/* optional */
"ramdisk", "cmdline", "flags",
"features", "arch_args", NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|ssiss#", kwd_list,
&dom, &store_evtchn,
&console_evtchn, &image,
/* optional */
&ramdisk, &cmdline, &flags,
&features, &arch_args, &unused) )
return NULL;
if ( xc_prose_build(self->xc_handle, dom, image,
ramdisk, cmdline, features, flags,
store_evtchn, &store_mfn,
console_evtchn, &console_mfn,
arch_args) != 0 ) {
if (!errno)
errno = EINVAL;
return PyErr_SetFromErrno(xc_error);
}
return Py_BuildValue("{s:i,s:i}",
"store_mfn", store_mfn,
"console_mfn", console_mfn);
}
static PyObject *pyxc_hvm_build(XcObject *self,
PyObject *args,
PyObject *kwds)
@@ -852,28 +811,6 @@ static PyObject *pyxc_domain_memory_increase_reservation(XcObject *self,
return zero;
}
#ifdef __powerpc__
static PyObject *pyxc_alloc_real_mode_area(XcObject *self,
PyObject *args,
PyObject *kwds)
{
uint32_t dom;
unsigned int log;
static char *kwd_list[] = { "dom", "log", NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "ii", kwd_list,
&dom, &log) )
return NULL;
if ( xc_alloc_real_mode_area(self->xc_handle, dom, log) )
return PyErr_SetFromErrno(xc_error);
Py_INCREF(zero);
return zero;
}
#endif
static PyObject *pyxc_domain_ioport_permission(XcObject *self,
PyObject *args,
PyObject *kwds)
@@ -982,6 +919,68 @@ static PyObject *dom_op(XcObject *self, PyObject *args,
return zero;
}
#ifdef __powerpc__
static PyObject *pyxc_alloc_real_mode_area(XcObject *self,
PyObject *args,
PyObject *kwds)
{
uint32_t dom;
unsigned int log;
static char *kwd_list[] = { "dom", "log", NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "ii", kwd_list,
&dom, &log) )
return NULL;
if ( xc_alloc_real_mode_area(self->xc_handle, dom, log) )
return PyErr_SetFromErrno(xc_error);
Py_INCREF(zero);
return zero;
}
static PyObject *pyxc_prose_build(XcObject *self,
PyObject *args,
PyObject *kwds)
{
uint32_t dom;
char *image, *ramdisk = NULL, *cmdline = "", *features = NULL;
int flags = 0;
int store_evtchn, console_evtchn;
unsigned long store_mfn = 0;
unsigned long console_mfn = 0;
void *arch_args = NULL;
int unused;
static char *kwd_list[] = { "dom", "store_evtchn",
"console_evtchn", "image",
/* optional */
"ramdisk", "cmdline", "flags",
"features", "arch_args", NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|ssiss#", kwd_list,
&dom, &store_evtchn,
&console_evtchn, &image,
/* optional */
&ramdisk, &cmdline, &flags,
&features, &arch_args, &unused) )
return NULL;
if ( xc_prose_build(self->xc_handle, dom, image,
ramdisk, cmdline, features, flags,
store_evtchn, &store_mfn,
console_evtchn, &console_mfn,
arch_args) != 0 ) {
if (!errno)
errno = EINVAL;
return PyErr_SetFromErrno(xc_error);
}
return Py_BuildValue("{s:i,s:i}",
"store_mfn", store_mfn,
"console_mfn", console_mfn);
}
#endif /* powerpc */
static PyMethodDef pyxc_methods[] = {
{ "handle",
@@ -1109,18 +1108,6 @@ static PyMethodDef pyxc_methods[] = {
" vcpus [int, 1]: Number of Virtual CPUS in domain.\n\n"
"Returns: [int] 0 on success; -1 on error.\n" },
{ "prose_build",
(PyCFunction)pyxc_prose_build,
METH_VARARGS | METH_KEYWORDS, "\n"
"Build a new Linux guest OS.\n"
" dom [int]: Identifier of domain to build into.\n"
" image [str]: Name of kernel image file. May be gzipped.\n"
" ramdisk [str, n/a]: Name of ramdisk file, if any.\n"
" cmdline [str, n/a]: Kernel parameters, if any.\n\n"
" vcpus [int, 1]: Number of Virtual CPUS in domain.\n\n"
"Returns: [int] 0 on success; -1 on error.\n" },
{ "hvm_build",
(PyCFunction)pyxc_hvm_build,
METH_VARARGS | METH_KEYWORDS, "\n"
@@ -1258,16 +1245,6 @@ static PyMethodDef pyxc_methods[] = {
" mem_kb [long]: .\n"
"Returns: [int] 0 on success; -1 on error.\n" },
#ifdef __powerpc__
{ "arch_alloc_real_mode_area",
(PyCFunction)pyxc_alloc_real_mode_area,
METH_VARARGS | METH_KEYWORDS, "\n"
"Allocate a domain's real mode area.\n"
" dom [int]: Identifier of domain.\n"
" log [int]: Specifies the area's size.\n"
"Returns: [int] 0 on success; -1 on error.\n" },
#endif
{ "domain_ioport_permission",
(PyCFunction)pyxc_domain_ioport_permission,
METH_VARARGS | METH_KEYWORDS, "\n"
@@ -1310,6 +1287,27 @@ static PyMethodDef pyxc_methods[] = {
" dom [int]: Domain whose time offset is being set.\n"
"Returns: [int] 0 on success; -1 on error.\n" },
#ifdef __powerpc__
{ "arch_alloc_real_mode_area",
(PyCFunction)pyxc_alloc_real_mode_area,
METH_VARARGS | METH_KEYWORDS, "\n"
"Allocate a domain's real mode area.\n"
" dom [int]: Identifier of domain.\n"
" log [int]: Specifies the area's size.\n"
"Returns: [int] 0 on success; -1 on error.\n" },
{ "arch_prose_build",
(PyCFunction)pyxc_prose_build,
METH_VARARGS | METH_KEYWORDS, "\n"
"Build a new Linux guest OS.\n"
" dom [int]: Identifier of domain to build into.\n"
" image [str]: Name of kernel image file. May be gzipped.\n"
" ramdisk [str, n/a]: Name of ramdisk file, if any.\n"
" cmdline [str, n/a]: Kernel parameters, if any.\n\n"
" vcpus [int, 1]: Number of Virtual CPUS in domain.\n\n"
"Returns: [int] 0 on success; -1 on error.\n" },
#endif /* __powerpc */
{ NULL, NULL, 0, NULL }
};
+9 -9
View File
@@ -270,15 +270,15 @@ class PPC_ProseImageHandler(LinuxImageHandler):
devtree = FlatDeviceTree.build(self)
return xc.prose_build(dom = self.vm.getDomid(),
memsize = mem_mb,
image = self.kernel,
store_evtchn = store_evtchn,
console_evtchn = console_evtchn,
cmdline = self.cmdline,
ramdisk = self.ramdisk,
features = self.vm.getFeatures(),
arch_args = devtree.to_bin())
return xc.arch_prose_build(dom = self.vm.getDomid(),
memsize = mem_mb,
image = self.kernel,
store_evtchn = store_evtchn,
console_evtchn = console_evtchn,
cmdline = self.cmdline,
ramdisk = self.ramdisk,
features = self.vm.getFeatures(),
arch_args = devtree.to_bin())
def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
"""@param shadow_mem_kb The configured shadow memory, in KiB.
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.