search for: meth_vararg

Displaying 20 results from an estimated 23 matches for "meth_vararg".

Did you mean: meth_varargs
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
...yObject *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 " { (char *) \"close\", guestfs_int_py_close, METH_VARARGS, NULL },\n"; pr " { (char *) \"set_event_callback\",\n"; @@ -728,6 +7...
2015 Sep 15
3
[PATCH 3/3] python: Allow bindings to be compiled with different version of libguestfs (RHBZ#1262983).
Patch to fix: https://bugzilla.redhat.com/show_bug.cgi?id=1262983 Note this won't help until the first two patches get backported to the stable branches, since <guestfs.h> won't define the necessary GUESTFS_HAVE_* macros. Rich.
2017 Jan 26
0
[nbdkit PATCH v2 5/6] python: Expose nbdkit_set_error to python script
...ject *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_load (void) { Py_Initialize (); + Py_InitModule("nbdkit",...
2006 Aug 30
3
arch-specific xc.c code?
...in''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" }, { &...
2008 Aug 30
3
Updated version of patch
Attached is a patch against shout-python-0.2 which does two trivial but very useful things (1) The function "get_connected" is exported so that shout-python becomes usable in nonblocking mode. In the current version of shout-python "open" raises an exception in nonblocking mode. (2) The global interpreter lock is released in the potentially blocking functions
2010 Sep 09
2
[PATCH]: add libxl python binding
...ot 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", (PyCFunction)pyxl_domain_shutdown, METH_VARARGS, + "Shutdown a domain"}, + {"domain_destroy", (PyCFunction)pyxl_domain_destroy, METH_VARARGS, + "Destroy a domain&quo...
2019 Aug 10
0
[PATCH libnbd 1/5] python: Change aio_buffer into nbd.Buffer class.
...aio_buffer_to_bytearray"; + "aio_buffer_size" ] @ List.map fst handle_calls); pr "\n"; pr "#endif /* LIBNBD_METHODS_H */\n" @@ -4009,8 +4011,10 @@ let generate_python_libnbdmod_c () = pr " { (char *) \"%s\", nbd_internal_py_%s, METH_VARARGS, NULL },\n" name name; ) ([ "create"; "close"; - "alloc_aio_buffer"; "aio_buffer_from_bytearray"; - "aio_buffer_to_bytearray" ] @ List.map fst handle_calls); + "alloc_aio_buffer"; + "aio_buff...
2019 Jun 03
3
[PATCH libnbd] api: nbd_get_version, nbd_supports_uri and nbd_get_package_name.
..."alloc_aio_buffer"; "aio_buffer_from_bytearray"; "aio_buffer_to_bytearray" ] @ List.map fst handle_calls); @@ -3035,7 +3078,7 @@ let generate_python_libnbdmod_c () = fun name -> pr " { (char *) \"%s\", nbd_internal_py_%s, METH_VARARGS, NULL },\n" name name; - ) ([ "create"; "close"; "get_package_name"; "get_package_version"; + ) ([ "create"; "close"; "alloc_aio_buffer"; "aio_buffer_from_bytearray"; "aio_buffer_t...
2019 Aug 10
7
[PATCH libnbd 0/5] WIP: python: Add test for doing asynch copy.
This doesn't yet work. However it does make me more convinced than ever that we really need to sort out persistent buffer lifetimes in the library (similar to what we did for closures). Rich.
2012 Mar 28
0
[LLVMdev] GSoC 2012 Proposal: Python bindings for LLVM
...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 name used in python, and _w ## func is the corresponding name of the wrapper function. ie, When we call a function func in python, it intrinsically calls the wrapper C funtcion _w ## func. So when we use LLVMAddFunction methoed in python, it actually calls _wLL...
2005 Oct 10
13
[PATCH] 0/2 VCPU creation and allocation
I''ve put together two patches. The first introduces a new dom0_op, set_max_vcpus, which with an associated variable and a check in the VCPUOP handler fixes [1]bug 288. Also included is a new VCPUOP, VCPUOP_create, which handles all of the vcpu creation tasks and leaves initialization and unpausing to VCPUOP_initialize. The separation allows for build-time allocation of vcpus which
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
2017 Oct 04
0
[PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...se_ascii c_name); pr "PyObject *\n"; pr "guestfs_int_py_%s (PyObject *self, PyObject *args)\n" name; @@ -585,7 +583,7 @@ and generate_python_module () = pr " { (char *) \"event_to_string\",\n"; pr " guestfs_int_py_event_to_string, METH_VARARGS, NULL },\n"; List.iter ( - fun { name = name; c_name = c_name } -> + fun { name; c_name } -> pr "#ifdef GUESTFS_HAVE_%s\n" (String.uppercase_ascii c_name); pr " { (char *) \"%s\", guestfs_int_py_%s, METH_VARARGS, NULL },\n"...
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).
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...uot;#ifdef %s_%s_BITMASK\n" c_optarg_prefix uc_n; pr " if (py_%s != Py_None && (optargs_s.bitmask & %s_%s_BITMASK) != 0)\n" n c_optarg_prefix uc_n; @@ -606,7 +607,7 @@ and generate_python_module () = pr " guestfs_int_py_event_to_string, METH_VARARGS, NULL },\n"; List.iter ( fun { name = name; c_name = c_name } -> - pr "#ifdef GUESTFS_HAVE_%s\n" (String.uppercase c_name); + pr "#ifdef GUESTFS_HAVE_%s\n" (String.uppercase_ascii c_name); pr " { (char *) \"%s\", guestfs_int_py_%...
2017 Oct 04
11
[PATCH 0/9] build: Require OCaml >= 4.02.
Per my previous email: https://www.redhat.com/archives/libguestfs/2017-September/msg00203.html I'd like to talk about requiring a more modern version of the OCaml compiler. These commits show some of the code changes which would be possible with OCaml >= 3.12 [which it turns out we already require by accident] and also with OCaml >= 4.02. The latter is my favoured option. Rich.
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
...ot;; 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"; pr "};\n"; pr "\n"; @@ -734,9 +734,9 @@ class GuestFS(object): "; List.iter ( - fun ({ name = name; style = ret, args, optargs; in...