1 files changed, 57 insertions(+), 106 deletions(-)
tools/python/xen/lowlevel/xc/xc.c | 163 ++++++++++++-------------------------
# HG changeset patch
# User Ryan Harper <ryanh@xxxxxxxxxx>
# Date 1169248739 21600
# Node ID 6e93a244722d7ee5bedbce4d2ee9e3ca46bea7ea
# Parent 8a5446bed383ac438f20137189f627ae9c4e771c
[PATCH] Sync tools/python/xen/lowlevel/xc/xc.c with xen-unstable.hg
Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>
diff -r 8a5446bed383 -r 6e93a244722d tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Fri Jan 19 17:18:59 2007 -0600
+++ b/tools/python/xen/lowlevel/xc/xc.c Fri Jan 19 17:18:59 2007 -0600
@@ -360,7 +360,6 @@ static PyObject *pyxc_linux_build(XcObje
unsigned int mem_mb;
unsigned long store_mfn = 0;
unsigned long console_mfn = 0;
- int unused;
static char *kwd_list[] = { "domid", "store_evtchn", "memsize",
"console_evtchn", "image",
@@ -368,12 +367,12 @@ static PyObject *pyxc_linux_build(XcObje
"ramdisk", "cmdline", "flags",
"features", NULL };
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssis#", kwd_list,
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssis", kwd_list,
&dom, &store_evtchn, &mem_mb,
&console_evtchn, &image,
/* optional */
&ramdisk, &cmdline, &flags,
- &features, &unused) )
+ &features) )
return NULL;
if ( xc_linux_build(self->xc_handle, dom, mem_mb, image,
@@ -442,6 +441,47 @@ static PyObject *pyxc_hvm_build(XcObject
return Py_BuildValue("{s:i}", "store_mfn", store_mfn);
}
+#ifdef __powerpc__
+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 int mem_mb;
+ unsigned long store_mfn = 0;
+ unsigned long console_mfn = 0;
+
+ static char *kwd_list[] = { "dom", "store_evtchn",
+ "console_evtchn", "image", "memsize",
+ /* optional */
+ "ramdisk", "cmdline", "flags",
+ "features", NULL };
+
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|ssis", kwd_list,
+ &dom, &store_evtchn,
+ &console_evtchn, &image, &mem_mb,
+ /* optional */
+ &ramdisk, &cmdline, &flags,
+ &features) )
+ return NULL;
+
+ if ( xc_prose_build(self->xc_handle, dom, mem_mb, image,
+ ramdisk, cmdline, features, flags,
+ store_evtchn, &store_mfn,
+ console_evtchn, &console_mfn) != 0 ) {
+ if (!errno)
+ errno = EINVAL;
+ return pyxc_error_to_exception();
+ }
+ return Py_BuildValue("{s:i,s:i}",
+ "store_mfn", store_mfn,
+ "console_mfn", console_mfn);
+}
+#endif /* powerpc */
+
static PyObject *pyxc_evtchn_alloc_unbound(XcObject *self,
PyObject *args,
PyObject *kwds)
@@ -915,68 +955,6 @@ static PyObject *dom_op(XcObject *self,
Py_INCREF(zero);
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 pyxc_error_to_exception();
-
- 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 int mem_mb;
- unsigned long store_mfn = 0;
- unsigned long console_mfn = 0;
- int unused;
-
- static char *kwd_list[] = { "dom", "store_evtchn",
- "console_evtchn", "image", "memsize",
- /* optional */
- "ramdisk", "cmdline", "flags",
- "features", NULL };
-
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssis#", kwd_list,
- &dom, &store_evtchn, &mem_mb,
- &console_evtchn, &image,
- /* optional */
- &ramdisk, &cmdline, &flags,
- &features, &unused) )
- return NULL;
-
- if ( xc_prose_build(self->xc_handle, dom, mem_mb, image,
- ramdisk, cmdline, features, flags,
- store_evtchn, &store_mfn,
- console_evtchn, &console_mfn) != 0 ) {
- if (!errno)
- errno = EINVAL;
- return pyxc_error_to_exception();
- }
- return Py_BuildValue("{s:i,s:i}",
- "store_mfn", store_mfn,
- "console_mfn", console_mfn);
-}
-#endif /* powerpc */
static PyMethodDef pyxc_methods[] = {
{ "handle",
@@ -1104,18 +1082,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"
@@ -1124,6 +1090,20 @@ static PyMethodDef pyxc_methods[] = {
" image [str]: Name of HVM loader image file.\n"
" vcpus [int, 1]: Number of Virtual CPUS in domain.\n\n"
"Returns: [int] 0 on success; -1 on error.\n" },
+
+#ifdef __powerpc__
+ { "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"
+ " mem_mb [int]: Amount of memory to allocate to domain.\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 */
{ "sched_id_get",
(PyCFunction)pyxc_sched_id_get,
@@ -1253,14 +1233,6 @@ static PyMethodDef pyxc_methods[] = {
" mem_kb [long]: .\n"
"Returns: [int] 0 on success; -1 on error.\n" },
- { "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" },
-
{ "domain_ioport_permission",
(PyCFunction)pyxc_domain_ioport_permission,
METH_VARARGS | METH_KEYWORDS, "\n"
@@ -1302,27 +1274,6 @@ static PyMethodDef pyxc_methods[] = {
"Set a domain's time offset to Dom0's localtime\n"
" 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 }
};
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|