search for: pymethoddef

Displaying 12 results from an estimated 12 matches for "pymethoddef".

2017 May 21
3
[PATCH 0/2] python: improved UTF8 decoding error handling
The Python 3 bindings currently are unable to deal with non UTF8 characters. This series continues what proposed in RHBZ#1406906. A new function 'set_decode_error_handler' allows the User to specify how to deal with decoding errors. The default behaviour will be raising a UnicodeDecodeError. If the handler is changed to 'surrogateescape', non UTF8 characters will be escaped in a
2017 May 21
0
[PATCH 2/2] python: unicode decode handler error scheme setter
...de_error_handler (PyObject *self, PyObject *args); extern PyObject *guestfs_int_py_create (PyObject *self, PyObject *args); extern PyObject *guestfs_int_py_close (PyObject *self, PyObject *args); @@ -577,6 +578,8 @@ and generate_python_module () = (* Table of functions. *) pr "static PyMethodDef methods[] = {\n"; + pr " { (char *) \"set_decode_error_handler\", \n"; + pr " guestfs_int_py_set_decode_error_handler, METH_VARARGS, NULL },\n"; pr " { (char *) \"create\", guestfs_int_py_create, METH_VARARGS, NULL },\n"; pr "...
2017 Jan 26
0
[nbdkit PATCH v2 5/6] python: Expose nbdkit_set_error to python script
...on/python.c @@ -54,6 +54,23 @@ static const char *script; static PyObject *module; +static PyObject * +set_error (PyObject *self, PyObject *args) +{ + int err; + + if (!PyArg_ParseTuple(args, "i", &err)) + return NULL; + nbdkit_set_error (err); + Py_RETURN_NONE; +} + +static PyMethodDef NbdkitMethods[] = { + { "set_error", set_error, METH_VARARGS, + "Store an errno value prior to throwing an exception" }, + { NULL } +}; + /* Is a callback defined? */ static int callback_defined (const char *name, PyObject **obj_rtn) @@ -91,6 +108,7 @@ static void py_lo...
2006 Aug 30
3
arch-specific xc.c code?
...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", +...
2012 Mar 28
0
[LLVMdev] GSoC 2012 Proposal: Python bindings for LLVM
..., func_ty.ptr) * If you are familiar with C extensions for Python, you could guess that LLVMAddFunction should be defined in the low-level wrapper file *_core.c*. Let's find out how it is defined in this wrapper file? In *_core.c*, the following statements are what we are looking for. *static PyMethodDef core_methods[] = { ... /* Functions */ _method( LLVMAddFunction ) ... }* LLVMAddFunction is defined as a macro. Let's look at what the macro _method mean? It is defined in _core.c: *#define _method( func ) { # func , _w ## func , METH_VARARGS },* In the above macro, func is the...
2006 Aug 01
18
[Patch] Enable "sysrq c" handler for domU coredump
Hi, In the case of linux, crash_kexec() is occured by "sysrq c". In the case of DomainU on xen, Help is occured by "sysrq c" now. So The way of dumping DomainU''s memory manualy is nothing. I fix this issue by the following way. 1. Panic is occured by "sysrq c" on both Domain0 and DomainU. 2. On DomainU, coredump is generated in /var/xen/dump (on Domain0).
2017 Jan 26
10
[nbdkit PATCH v2 0/6] bind .zero to Python
Fix some things I noticed while reviewing v1, and follow Rich's idea to add a new nbdkit_set_error() utility function with a binding for Python users to request a particular error (rather than being forced to live with whatever stale value is in errno after all the intermediate binding glue code). I could not easily find out how to register a C function callable from perl bindings, and have
2010 Sep 09
2
[PATCH]: add libxl python binding
...if ( !PyArg_ParseTuple(args, "i|i", &domid, &force) ) + return NULL; + if ( libxl_domain_destroy(&self->ctx, domid, force) ) { + PyErr_SetString(xl_error_obj, "cannot destroy domain"); + return NULL; + } + return Py_None; +} + +static PyMethodDef pyxl_methods[] = { + {"list_domains", (PyCFunction)pyxl_list_domains, METH_NOARGS, + "List domains"}, + {"domid_to_name", (PyCFunction)pyxl_domid_to_name, METH_VARARGS, + "Retrieve name from domain-id"}, + {"domain_shutdown"...
2012 May 15
5
[PATCH 0 of 4 v3] Add commands to automatically prep devices for pass-through
Add commands to automatically prep devices for pass-through The current method for passing through devices requires users to either modify cryptic Linux boot parameters and reboot, or do a lot of manual reads and writes into sysfs nodes. This set of patches introduces commands to make this easier. It expands on the concept of "assignable" (from the list_assignable_devices command).
2017 Jan 27
6
[nbdkit PATCH v3 0/4] bind .zero to Python
This cleans up the existing code base with regards to implicit use of errno from language bindings, then rebases the previous work in python on top of that. I'm still playing with the perl bindings, but got further after reading 'perldoc perlembed'. Eric Blake (4): plugins: Don't use bogus errno from non-C plugins plugins: Add new nbdkit_set_error() utility function python:
2013 Feb 04
1
[PATCH] generator: Add visibility to action struct
...l_functions); (* Python wrapper functions. *) List.iter ( @@ -528,7 +528,7 @@ free_strings (char **argv) pr " return py_r;\n"; pr "}\n"; pr "\n" - ) all_functions; + ) external_functions; (* Table of functions. *) pr "static PyMethodDef methods[] = {\n"; @@ -542,7 +542,7 @@ free_strings (char **argv) fun { name = name } -> pr " { (char *) \"%s\", py_guestfs_%s, METH_VARARGS, NULL },\n" name name - ) all_functions; + ) external_functions; pr " { NULL, NULL, 0, NULL }\n&qu...
2016 Sep 02
6
[PATCH 0/4] generator: Some work to split large C files
By splitting up large C files we can make parallel compiles a bit faster. Rich.