Displaying 12 results from an estimated 12 matches for "nbd_aio_block_status_callback".
2019 Jul 17
3
[nbdkit PATCH 0/2] Another libnbd API bump
libnbd 0.1.7 was released today, which breaks compilation of
nbdkit-nbd-plugin. We could work around it by using #ifdef
LIBNBD_HAVE_XXX to learn about the renamed functions, but supporting
older versions is not all that important when we don't yet have API
stability. So patch 1 copes by just bumping the minimum version
instead, except that we have yet another pending libnbd patch with an
API
2019 Jul 22
1
Re: [libnbd] More thoughts on callbacks and more
This has an annoying subtlety around the fact that we can pass a
single user_data and multiple closures in one function call.
The LIBNBD_CALLBACK_FREE function would be called several times with
the same user_data in this case, which means the callback must do some
kind of reference counting before the user_data can be freed.
I propose that we split up Closure so it describes a single closure,
2019 Jul 25
0
[libnbd PATCH] lib: Call read/extent(FREE) before callback(VALID|FREE)
Some callers of nbd_aio_pread_structured_callback or
nbd_aio_block_status_callback share the same opaque pointer to both
calls, with the intent to only free the pointer on the completion
callback. Although our documentation does not explicitly specify the
order in which callbacks are made, allowing the callback(FREE) to
occur prior to the read(FREE) puts a burden on the client t...
2019 Jul 17
0
[nbdkit PATCH 2/2] nbd: Another libnbd API bump
...fy, 0));
+ nbdplug_notify, &s, 0));
return nbdplug_reply (h, &s);
}
@@ -777,8 +777,9 @@ nbdplug_extents (void *handle, uint32_t count, uint64_t offset,
nbdplug_prepare (&s);
s.extents = extents;
nbdplug_register (h, &s, nbd_aio_block_status_callback (h->nbd, count, offset,
- &s, nbdplug_extent,
- nbdplug_notify, f));
+ nbdplug_extent,
+...
2019 Jul 17
0
Re: [PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
...nder the hood, and offers
enough separation that the generator does not have to be aware of
cross-API ties.
It may also simplify the generator in that we'd be back to never having
more than one Closure per function (compared to our current two
functions in nbd_aio_pread_structured_callback and
nbd_aio_block_status_callback), where handling a Closure in the
generator doesn't need List.iter.
The other thing this example pointed out was that in a single-threaded
main loop, the callback function can't retire a command itself, but it
is hairy to wire up anything else to retire the command and nothing
further is t...
2019 Jul 27
3
[PATCH libnbd] lib: Use symbol versions.
...versions appearing, and the test/example programs continue to run.
$ nm -D --with-symbol-versions lib/.libs/libnbd.so.0 | grep LIBNBD
0000000000000000 A LIBNBD_1.0@@LIBNBD_1.0
0000000000005470 T nbd_add_meta_context@@LIBNBD_1.0
00000000000085d0 T nbd_aio_block_status@@LIBNBD_1.0
0000000000008710 T nbd_aio_block_status_callback@@LIBNBD_1.0
0000000000008110 T nbd_aio_cache@@LIBNBD_1.0
0000000000008230 T nbd_aio_cache_callback@@LIBNBD_1.0
00000000000089e0 T nbd_aio_command_completed@@LIBNBD_1.0
0000000000006f20 T nbd_aio_connect@@LIBNBD_1.0
0000000000007320 T nbd_aio_connect_command@@LIBNBD_1.0
[etc]
$ nm -D --with-symbol-...
2019 Aug 15
3
[nbdkit PATCH] nbd: Another libnbd version bump
...struct transaction s;
uint32_t f = flags & NBDKIT_FLAG_REQ_ONE ? LIBNBD_CMD_FLAG_REQ_ONE : 0;
+ nbd_extent_callback extcb = { nbdplug_extent, extents };
assert (!(flags & ~NBDKIT_FLAG_REQ_ONE));
nbdplug_prepare (&s);
- s.extents = extents;
- nbdplug_register (h, &s, nbd_aio_block_status_callback (h->nbd, count, offset,
- nbdplug_extent, &s,
- nbdplug_notify, &s,
- f));
+ nbdplug_register (h, &s, nbd_aio_bl...
2019 Jul 17
2
Re: [PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
On 7/17/19 8:00 AM, Richard W.M. Jones wrote:
> ---
> .gitignore | 1 +
> README | 2 +
> configure.ac | 9 +
> examples/Makefile.am | 22 ++
> examples/glib-main-loop.c | 511 ++++++++++++++++++++++++++++++++++++++
> 5 files changed, 545 insertions(+)
Looks good.
>
> + revents = g_source_query_unix_fd
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...t idiomatic OCaml - but hey, it
taught me a lot about OCaml. Writing a 'string * callback list' proved
to be a rather interesting exercise]
Our C code has a couple of functions that want to take multiple
callback functions that share a single opaque data
(nbd_aio_pread_structured_callback; nbd_aio_block_status_callback).
However, the mapping of this construct to Python passed only the
opaque handle of the first function to the second callback wrapper,
which means we would invoke the wrong Python Callable; better is
tracking a single malloc()d structure containing the Python opaque
object, and ALL of the Python Ca...
2019 Jul 16
3
[RFC libnbd PATCH 0/2] Start fixing python nbd.pread_structured_callback
Posting now that I got something to compile (at the expense of
breaking OCaml bindings), but I'm open to ideas on how to improve it.
Eric Blake (2):
generator: Tweak print_c_arg_list to take alternate first arg
RFC: generator: Handle shared callbacks in Python
generator/generator | 556 ++++++++++++++++++++++----------------------
1 file changed, 280 insertions(+), 276 deletions(-)
--
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...ck status command to the NBD server";
- longdesc = "\
-Send the block status command to the NBD server. This returns the
-unique positive 64 bit cookie for this command, or C<-1> on
-error. To check if the command completed, call
-C<nbd_aio_command_completed>, or use C<nbd_aio_block_status_callback>.
-Parameters behave as documented in C<nbd_block_status>.";
- };
-
- "aio_block_status_callback", {
default_call with
args = [ UInt64 "count"; UInt64 "offset"; Closure extent_closure ];
optargs = [ OClosure completion_closure; OFlags (&q...
2019 Aug 13
2
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
This applies on top of the OClosure v2 series posted a few
minutes ago.
Rich.