search for: free_aio_buff

Displaying 5 results from an estimated 5 matches for "free_aio_buff".

Did you mean: free_aio_buffer
2019 Aug 11
4
[PATCH libnbd v2 0/3] python: Add test for doing asynch copy.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-August/msg00103.html In v2 I've made several changes: - Fix Python callbacks so if they don't return something which is int-like, we assume they mean to return 0. - Add nbd.Buffer free() method. Read commit message in patch 2 to see what this is about. - Fixed the asynch copy test to deal with the unbelievably
2019 Aug 10
0
[PATCH libnbd 1/5] python: Change aio_buffer into nbd.Buffer class.
...nternal_py_close (PyObject *self, PyObject *args) return Py_None; } -static char aio_buffer_name[] = "struct py_aio_buffer"; +static const char aio_buffer_name[] = "nbd.Buffer"; struct py_aio_buffer * nbd_internal_py_get_aio_buffer (PyObject *capsule) @@ -89,9 +89,7 @@ free_aio_buffer (PyObject *capsule) free (buf); } -/* Allocate a persistent buffer used for nbd_aio_pread and - * nbd_aio_pwrite. - */ +/* Allocate a persistent buffer used for nbd_aio_pread. */ PyObject * nbd_internal_py_alloc_aio_buffer (PyObject *self, PyObject *args) { @@ -115,7 +113,7 @@ nbd_intern...
2019 Jun 03
3
[PATCH libnbd] api: nbd_get_version, nbd_supports_uri and nbd_get_package_name.
...) +{ + return PACKAGE_VERSION; +} + +int +nbd_unlocked_supports_uri (struct nbd_handle *h) +{ +#ifdef HAVE_LIBXML2 + return 1; +#else + return 0; +#endif +} diff --git a/python/handle.c b/python/handle.c index 7b5e139..7cff41a 100644 --- a/python/handle.c +++ b/python/handle.c @@ -89,28 +89,6 @@ free_aio_buffer (PyObject *capsule) free (buf); } -PyObject * -nbd_internal_py_get_package_name (PyObject *self, PyObject *args) -{ - static char name[] = PACKAGE_NAME; - - if (!PyArg_ParseTuple (args, (char *) ":nbd_internal_py_get_package_name")) - return NULL; - - return PyUnicode_FromSt...
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.
2020 Sep 10
1
[libnbd PATCH] python: Fix more memory leaks
...ython/handle.c @@ -1,5 +1,5 @@ /* NBD client library in userspace - * Copyright (C) 2013-2019 Red Hat Inc. + * Copyright (C) 2013-2020 Red Hat Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -91,7 +91,8 @@ free_aio_buffer (PyObject *capsule) { struct py_aio_buffer *buf = PyCapsule_GetPointer (capsule, aio_buffer_name); - free (buf->data); + if (buf) + free (buf->data); free (buf); } diff --git a/python/utils.c b/python/utils.c index e0929dc..0e3164c 100644 --- a/python/utils.c +++ b/python/uti...