# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID e080700efa56b7b31326aafc717ce65211382309
# Parent 1fa7e524b354ee49b6925037dd463e65948b4716
[TOOLS] Fix the build. Clearly demarcate PPC-specific stuff.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
tools/libxc/xenctrl.h | 8 -
tools/libxc/xenguest.h | 1
tools/python/xen/lowlevel/xc/xc.c | 168 ++++++++++++++++++--------------------
tools/python/xen/xend/image.py | 18 ++--
4 files changed, 97 insertions(+), 98 deletions(-)
diff -r 1fa7e524b354 -r e080700efa56 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h Wed Dec 13 10:14:40 2006 +0000
+++ b/tools/libxc/xenctrl.h Wed Dec 13 10:23:53 2006 +0000
@@ -447,10 +447,6 @@ int xc_domain_memory_populate_physmap(in
unsigned int address_bits,
xen_pfn_t *extent_start);
-int xc_alloc_real_mode_area(int xc_handle,
- uint32_t domid,
- unsigned int log);
-
int xc_domain_ioport_permission(int xc_handle,
uint32_t domid,
uint32_t first_port,
@@ -732,4 +728,8 @@ const char *xc_error_code_to_desc(int co
*/
xc_error_handler xc_set_error_handler(xc_error_handler handler);
+/* PowerPC specific. */
+int xc_alloc_real_mode_area(int xc_handle,
+ uint32_t domid,
+ unsigned int log);
#endif
diff -r 1fa7e524b354 -r e080700efa56 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h Wed Dec 13 10:14:40 2006 +0000
+++ b/tools/libxc/xenguest.h Wed Dec 13 10:23:53 2006 +0000
@@ -122,6 +122,7 @@ int xc_get_hvm_param(
int xc_get_hvm_param(
int handle, domid_t dom, int param, unsigned long *value);
+/* PowerPC specific. */
int xc_prose_build(int xc_handle,
uint32_t domid,
unsigned int mem_mb,
diff -r 1fa7e524b354 -r e080700efa56 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Wed Dec 13 10:14:40 2006 +0000
+++ b/tools/python/xen/lowlevel/xc/xc.c Wed Dec 13 10:23:53 2006 +0000
@@ -386,47 +386,6 @@ static PyObject *pyxc_linux_build(XcObje
"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_incr
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,
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"
@@ -1309,6 +1286,27 @@ 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 }
};
diff -r 1fa7e524b354 -r e080700efa56 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py Wed Dec 13 10:14:40 2006 +0000
+++ b/tools/python/xen/xend/image.py Wed Dec 13 10:23:53 2006 +0000
@@ -270,15 +270,15 @@ class PPC_ProseImageHandler(LinuxImageHa
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.
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|