Hi Ewan/Alistair, I have a patch that looks like this: diff -r a39ad4c78850 tools/libxc/xenctrl.h --- a/tools/libxc/xenctrl.h Wed Aug 30 13:51:12 2006 +0100 +++ b/tools/libxc/xenctrl.h Wed Aug 30 15:11:20 2006 -0500 @@ -416,6 +416,10 @@ 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_translate_gpfn_list(int xc_handle, uint32_t domid, unsigned long nr_gpfns, diff -r a39ad4c78850 tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Wed Aug 30 13:51:12 2006 +0100 +++ b/tools/python/xen/lowlevel/xc/xc.c Wed Aug 30 15:11:20 2006 -0500 @@ -732,6 +732,26 @@ static PyObject *pyxc_domain_memory_incr return zero; } +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_domain_ioport_permission(XcObject *self, PyObject *args, PyObject *kwds) @@ -1088,6 +1108,14 @@ static PyMethodDef pyxc_methods[] = { "Increase a domain''s memory reservation\n" " dom [int]: Identifier of domain.\n" " 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", xc_alloc_real_mode_area() is a PowerPC-specific libxc function. How would you like this handled in xc.c? Just an ifdef? -- Hollis Blanchard IBM Linux Technology Center _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, Aug 30, 2006 at 03:40:47PM -0500, Hollis Blanchard wrote:> Hi Ewan/Alistair, I have a patch that looks like this: > > [Snip] > > xc_alloc_real_mode_area() is a PowerPC-specific libxc function. How > would you like this handled in xc.c? Just an ifdef?I''d like the xc object to be a direct reflection of what''s in libxenguest and libxenctrl, so if you''ve got an arch-specific #ifdef that puts this function into libxc, then yes, just using that would be fine. (I don''t see that function in my tree, so I can''t see for myself which library it ends up in). Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, 2006-08-31 at 19:44 +0100, Ewan Mellor wrote:> On Wed, Aug 30, 2006 at 03:40:47PM -0500, Hollis Blanchard wrote: > > > Hi Ewan/Alistair, I have a patch that looks like this: > > > > xc_alloc_real_mode_area() is a PowerPC-specific libxc function. How > > would you like this handled in xc.c? Just an ifdef? > > I''d like the xc object to be a direct reflection of what''s in libxenguest and > libxenctrl, so if you''ve got an arch-specific #ifdef that puts this function > into libxc, then yes, just using that would be fine. (I don''t see that > function in my tree, so I can''t see for myself which library it ends up in).Yeah, I''m adding that function to libxc but wasn''t sure how to modify xc.c to expose it. In libxc, whole files are conditionally built (so technically no ifdef is used), but I will add an ifdef to xc.c. Thanks. -- Hollis Blanchard IBM Linux Technology Center _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 31/8/06 8:08 pm, "Hollis Blanchard" <hollisb@us.ibm.com> wrote:>> I''d like the xc object to be a direct reflection of what''s in libxenguest and >> libxenctrl, so if you''ve got an arch-specific #ifdef that puts this function >> into libxc, then yes, just using that would be fine. (I don''t see that >> function in my tree, so I can''t see for myself which library it ends up in). > > Yeah, I''m adding that function to libxc but wasn''t sure how to modify > xc.c to expose it. In libxc, whole files are conditionally built (so > technically no ifdef is used), but I will add an ifdef to xc.c. Thanks.It''d be nice to have arch-specific files/directories for the Python wrapper too, if that''s not too much hassle. An arch-specific file that exported an arch-specific python object that gets attached to the main xc object with name ''arch'' would be kind of neat (so that you get at arch-specific functions as e.g., xc.arch.alloc_real(...), making the arch-specific calls immediately obvious). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Reasonably Related Threads
- [PATCH 4/6] xen: export NUMA topology in physinfo hcall
- error while static linking of libxenctrl and libxenguest
- Bug#710650: xen-api: FTBFS: gcc: error: /home/blank/debian/xen/releases/xen/xen-4.2.1/debian/build/build-utils_amd64/tools/ocaml/libs/xc/../../../../tools/libxc/libxenctrl.so: No such file or directory- build ocaml/xapi rrddump.opt
- [PATCH] Store page and evtchn in start_info_t
- [PATCH] 3/4 "nemesis" scheduling domains for Xen