search for: get_all_event_callbacks

Displaying 20 results from an estimated 25 matches for "get_all_event_callbacks".

2017 Mar 03
5
[PATCH v2 0/4] Avoid 0-bytes malloc in bindings
...hen closing an handle, because there were no event handlers registered. Since this can have different behaviours in POSIX, avoid that situation altogether by just skipping allocating anything when there were no event handlers. Thanks, Pino Toscano (4): ocaml: do not try to malloc 0 elements in get_all_event_callbacks python: do not try to malloc 0 elements in get_all_event_callbacks ruby: do not try to malloc 0 elements in get_all_event_callbacks java: do not try to malloc 0 elements in get_all_event_callbacks java/handle.c | 17 ++++++++++++----- ocaml/guestfs-c.c | 17 ++++++++++++-...
2017 Mar 03
1
Re: [PATCH 08/11] ocaml: do not try to malloc 0 elements in get_all_event_callbacks
On Fri, Mar 03, 2017 at 03:33:02PM +0100, Pino Toscano wrote: > In case there are no event handlers registered with the handle, > get_all_event_callbacks will count 0 elements, trying to malloc a buffer > of that size. POSIX says that this can result in either a null pointer, > or an unusable pointer. Since we assume a null pointer means failure, > then always add a null element at the end, so we do not rely on > implementation-defined...
2017 Mar 03
14
[PATCH 00/11] Various Coverity fixes
...ory access for FBuffer in struct lists daemon: tsk: properly use GUESTFS_MAX_CHUNK_SIZE edit: fix small memory leak on error java: fix possible memory leak on error fish: fully init the msghdr buffers tail: pass the right path for Windows guests ocaml: do not try to malloc 0 elements in get_all_event_callbacks python: do not try to malloc 0 elements in get_all_event_callbacks ruby: do not try to malloc 0 elements in get_all_event_callbacks java: do not try to malloc 0 elements in get_all_event_callbacks cat/tail.c | 2 +- common/edit/file-edit.c | 1 + daemon/sleuthkit.c |...
2017 Mar 03
0
[PATCH 08/11] ocaml: do not try to malloc 0 elements in get_all_event_callbacks
In case there are no event handlers registered with the handle, get_all_event_callbacks will count 0 elements, trying to malloc a buffer of that size. POSIX says that this can result in either a null pointer, or an unusable pointer. Since we assume a null pointer means failure, then always add a null element at the end, so we do not rely on implementation-defined behaviour of malloc...
2016 Feb 05
7
[PATCH 0/7] lib: Stop exporting the safe_malloc, etc. functions.
The safe_malloc (etc) functions call g->abort_fn on failure. That's not appropriate for language bindings, and we never intended that these internal functions be used from language bindings, that was just a historical accident. This patch series removes any external use of the safe_* functions. Rich.
2014 May 27
2
[PATCH] ruby: add :nodoc: comment for internal methods
This way they are ignored by rdoc. --- generator/ruby.ml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/generator/ruby.ml b/generator/ruby.ml index 1111993..88762ca 100644 --- a/generator/ruby.ml +++ b/generator/ruby.ml @@ -522,6 +522,15 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn) * +guestfs_%s+[http://libguestfs.org/guestfs.3.html#guestfs_%s]). */ " f.name args ret f.shortdesc doc f.name f.name + ) else ( + pr "\ +/* + * call-seq: + * g.%s + * + * :nodoc: + */ +" f.name ); (* Generate the func...
2015 Oct 02
1
[PATCH] ruby: improve rdoc markup
...* Call - * +guestfs_event_to_string+[http://libguestfs.org/guestfs.3.html#guestfs_event_to_string] + * {guestfs_event_to_string}[http://libguestfs.org/guestfs.3.html#guestfs_event_to_string] * to convert an event or event bitmask into a printable string. */ static VALUE @@ -477,13 +477,18 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn) if f.protocol_limit_warning then doc ^ "\n\n" ^ protocol_limit_warning else doc in - let doc = - match deprecation_notice f with - | None -> doc - | Some txt -> doc ^ "\n\n&quot...
2017 May 11
1
[PATCH] python: improve few exceptions thrown on error
...-237,7 +237,7 @@ guestfs_int_py_event_to_string (PyObject *self, PyObject *args) str = guestfs_event_to_string (events); if (str == NULL) { - PyErr_SetString (PyExc_RuntimeError, strerror (errno)); + PyErr_SetFromErrno (PyExc_RuntimeError); return NULL; } @@ -271,7 +271,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn) /* Copy them into the return array. */ r = malloc (sizeof (PyObject *) * (*len_rtn)); if (r == NULL) { - PyErr_SetNone (PyExc_MemoryError); + PyErr_NoMemory (); return NULL; } @@ -298,7 +298,7 @@ guestfs_int_py_get_string_list (PyObject *obj)...
2016 May 05
1
[PATCH] python: use constants instead of raw values
...self._o = libguestfsmod.create(flags) self._python_return_dict = python_return_dict diff --git a/python/guestfs-py-byhand.c b/python/guestfs-py-byhand.c index cf8576f..9e2debf 100644 --- a/python/guestfs-py-byhand.c +++ b/python/guestfs-py-byhand.c @@ -37,6 +37,13 @@ static PyObject **get_all_event_callbacks (guestfs_h *g, size_t *len_rtn); +void +guestfs_int_py_extend_module (PyObject *module) +{ + PyModule_AddIntMacro(module, GUESTFS_CREATE_NO_ENVIRONMENT); + PyModule_AddIntMacro(module, GUESTFS_CREATE_NO_CLOSE_ON_EXIT); +} + PyObject * guestfs_int_py_create (PyObject *self, PyObject *args)...
2014 Feb 10
5
[PATCH 0/4] add GUID validation (RHBZ#1008417)
Hi, this patch serie adds a new GUID type in the generator, which would do the same as String, but also validating (just in the C output) the passed GUID string. This allows to reject invalid GUIDs before passing them to low-level tools. Pino Toscano (4): utils: add a function to validate a GUID string generator: add a GUID parameter type generator: generate code for parameter validation
2015 Oct 20
3
[PATCH 1/2] generator: add a RelativePathnameList parameter type
...; n | BufferIn n -> pr "byte[] %s" n - | StringList n | DeviceList n -> + | StringList n | DeviceList n | RelativePathnameList n -> pr "String[] %s" n | Bool n -> pr "boolean %s" n @@ -846,7 +846,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn) pr ", jstring j%s" n | BufferIn n -> pr ", jbyteArray j%s" n - | StringList n | DeviceList n -> + | StringList n | DeviceList n | RelativePathnameList n -> pr ", jobjectAr...
2015 Oct 21
2
[PATCH 1/2] generator: add a FilenameList parameter type
...%s" n | BufferIn n -> pr "byte[] %s" n - | StringList n | DeviceList n -> + | StringList n | DeviceList n | FilenameList n -> pr "String[] %s" n | Bool n -> pr "boolean %s" n @@ -846,7 +846,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn) pr ", jstring j%s" n | BufferIn n -> pr ", jbyteArray j%s" n - | StringList n | DeviceList n -> + | StringList n | DeviceList n | FilenameList n -> pr ", jobjectArray j%s&...
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
...tfs API handles.\"\"\" diff --git a/python/handle.c b/python/handle.c index 52c36f1d2..b665bb899 100644 --- a/python/handle.c +++ b/python/handle.c @@ -35,6 +35,8 @@ #include "actions.h" +static const char *decode_error_handler = "strict"; + static PyObject **get_all_event_callbacks (guestfs_h *g, size_t *len_rtn); void @@ -45,6 +47,17 @@ guestfs_int_py_extend_module (PyObject *module) } PyObject * +guestfs_int_py_set_decode_error_handler (PyObject *self, PyObject *args) +{ + const char *previous_handler = decode_error_handler; + + if (!PyArg_ParseTuple (args, (char *)...
2014 Dec 10
2
[PATCH v1 0/2] Implement guestfs_add_libvirt_dom.
This is only lightly tested at the moment. For context see: https://bugzilla.redhat.com/show_bug.cgi?id=1138203#c40 https://bugzilla.redhat.com/show_bug.cgi?id=1075143 https://bugzilla.redhat.com/show_bug.cgi?id=1075164 Note this is not a complete fix. At least one more libguestfs patch is required (to implement virDomainPtr in the python bindings). Plus a virt-manager patch. Rich.
2014 Dec 10
3
[PATCH v2 0/3] Implement guestfs_add_libvirt_dom.
This completes the implementation on the libguestfs side, allowing python-libvirt dom pointers to be passed to guestfs_add_libvirt_dom. For context see: https://bugzilla.redhat.com/show_bug.cgi?id=1138203#c40 https://bugzilla.redhat.com/show_bug.cgi?id=1075143 https://bugzilla.redhat.com/show_bug.cgi?id=1075164 Rich.
2014 Dec 11
4
[PATCH v3 0/4] Implement guestfs_add_libvirt_dom.
A hopefully cleaner implementation this time. It doesn't require any special insights into how libvirt-python is implemented. Instead, it requires a change to libvirt-python to add a .c_pointer() method: https://www.redhat.com/archives/libvir-list/2014-December/msg00615.html Rich.
2014 Dec 11
6
[PATCH v4 0/6] Implement guestfs_add_libvirt_dom.
Since v3: - Fix labelling over overlays (see 6/6) - Tested it with a test program which simulates what virt-manager will do. See the attachment here: https://bugzilla.redhat.com/show_bug.cgi?id=1075164#c7 Rich.
2016 Feb 26
1
[PATCH] doc: add info on per-function needed feature
...oc = List.map (fun line -> replace_str line "\\" "\\\\") doc in let doc = String.concat "\n " doc in diff --git a/generator/ruby.ml b/generator/ruby.ml index 9567925..97ccfdc 100644 --- a/generator/ruby.ml +++ b/generator/ruby.ml @@ -481,6 +481,11 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn) | { deprecated_by = None } -> doc | { deprecated_by = Some alt } -> doc ^ (sprintf "\n *\n * [Deprecated] In new code, use rdoc-ref:%s instead." alt) in + let doc = + match f.optional with +...
2013 Jan 24
3
[REVIEW ONLY] Mountable patches
These 3 patches implement support for APIs which must accept a mountable, but don't update apis which must return mountables. Matt