Displaying 15 results from an estimated 15 matches for "nbd_aio_".
2019 Aug 13
1
Re: [PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
On 8/13/19 10:37 AM, Richard W.M. Jones wrote:
> The original nbd_aio_* (non-callback) functions are removed and
> replaced with the renamed callback variants.
>
> This is a simple mechanical change to the API:
>
> (1) Any existing call to nbd_aio_*_callback can simply be renamed to
> nbd_aio_*
>
> (2) Any existing call to nbd_aio_* must...
2019 Jul 15
2
[libnbd] notify API changes (was: Re: [libnbd PATCH 5/6] api: Add new nbd_aio_FOO_notify functions)
...gt; commands are complete. It's also desirable when writing a server
> validation program (such as for checking structured reads for
> compliance) to be able to clean up the associated opaque data and have
> a final chance to change the overall command status.
>
> Introduce new nbd_aio_FOO_notify functions for each command. Rewire
> the existing nbd_aio_FOO to forward to the new command. (Perhaps the
> generator could reduce some of the boilerplate duplication, if a later
> patch wants to refactor this).
I'm writing some code now using these new nbd_aio_<CMD>_...
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.
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
The original nbd_aio_* (non-callback) functions are removed and
replaced with the renamed callback variants.
This is a simple mechanical change to the API:
(1) Any existing call to nbd_aio_*_callback can simply be renamed to
nbd_aio_*
(2) Any existing call to nbd_aio_* must have two extra NULL parameters
adde...
2019 Jul 15
0
Re: [libnbd] notify API changes (was: Re: [libnbd PATCH 5/6] api: Add new nbd_aio_FOO_notify functions)
...mplete. It's also desirable when writing a server
>> validation program (such as for checking structured reads for
>> compliance) to be able to clean up the associated opaque data and have
>> a final chance to change the overall command status.
>>
>> Introduce new nbd_aio_FOO_notify functions for each command. Rewire
>> the existing nbd_aio_FOO to forward to the new command. (Perhaps the
>> generator could reduce some of the boilerplate duplication, if a later
>> patch wants to refactor this).
>
> I'm writing some code now using these ne...
2023 Jul 14
2
[libnbd PATCH 1/2] api: Tighten rules on completion.callback
On Fri, Jul 14, 2023 at 09:13:42AM +0200, Laszlo Ersek wrote:
> On 7/13/23 21:29, Eric Blake wrote:
> > The documentation has claimed since commit 6f4dcdab that any
> > completion callback will be called exactly once; but this is not
> > consistent with the code: if nbd_aio_* itself returns an error, then
> > nothing is queued and the user does not need to wait for a completion
> > callback to know how the command failed. We could tweak the generator
> > to call completion.callback no matter what, but since the
> > completion.free callback alre...
2023 Jul 16
1
[libnbd PATCH 1/2] api: Tighten rules on completion.callback
...n Fri, Jul 14, 2023 at 09:13:42AM +0200, Laszlo Ersek wrote:
>> On 7/13/23 21:29, Eric Blake wrote:
>>> The documentation has claimed since commit 6f4dcdab that any
>>> completion callback will be called exactly once; but this is not
>>> consistent with the code: if nbd_aio_* itself returns an error, then
>>> nothing is queued and the user does not need to wait for a completion
>>> callback to know how the command failed. We could tweak the generator
>>> to call completion.callback no matter what, but since the
>>> completion.free c...
2019 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
Mutable (Int n) => int *n
This can currently only be used for callback arguments of type int
(not for other types, nor for any ordinary function arguments), but it
could be implemented more generally in future.
---
generator/generator | 75 +++++++++++++++++++++++++++++++++++++--------
1 file changed, 63 insertions(+), 12 deletions(-)
diff --git a/generator/generator b/generator/generator
2019 Jul 20
2
[libnbd] More thoughts on callbacks and more
...for the completion signal before
reentering the library. (2) If there's some implicit guarantee that
we should call the callback as easy as possible after the command
finishes.
I think (1) is not possible in ordinary code since callers must always
enter the main loop after calling one of the nbd_aio_* functions.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
htt...
2019 Jul 23
4
[libnbd PATCH] api: Allow completion callbacks to auto-retire
When using the nbd_aio_FOO_callback commands, there is nothing further
to be learned about the command by calling nbd_aio_command_completed()
compared to what the callback already had access to. There are still
scenarios where manually retiring the command after the fact is useful
(whether the return was 0 to keep the st...
2020 Sep 07
0
[libnbd PATCH 2/2] generator: Free closures on failure
We can easily demonstrate a memory leak when repeatedly calling
nbd_aio_pread from nbdsh in the wrong state. True, that isn't
something a sane client would normally do, but it's worth fixing.
The culprit: when nbd_aio_pread returns a cookie, we guarantee to
clean up the closure, but if we fail early and never scheduled the
command, nothing ever cleans up the c...
2023 Jul 13
2
[libnbd PATCH 0/2] Fix docs and testing of completion callback
...reports errors); we could instead try to go the
other direction and tweak the generator to guarantee that both
completion.callback and completion.free are reached no matter what,
but that felt more invasive to me.
Eric Blake (2):
api: Tighten rules on completion.callback
tests: Add coverage of nbd_aio_opt_* in wrong state
docs/libnbd.pod | 26 +++--
lib/handle.c | 3 +
lib/opt.c | 2 +
tests/Makefile.am | 5 +
tests/closure-lifetimes.c | 14 +++
tests/errors-not-negotiating-aio.c | 170 ++++++++++...
2020 Jul 24
4
[libnbd PATCH 0/3] Expose server block size constraints
...requests.
At some point, we may want to add synchronous convenience API wrappers
that do request splitting or read-modify-write to obey server
constraints while still appearing to the library client as accepting
any possible request. But such a wrapper should only be synchronous
and not copied to nbd_aio_*, because getting locking right is a bear
if you have two non-overlapping client requests that want to visit the
same larger-granularity window of the server in parallel.
Eric Blake (3):
states: Request NBD_INFO_BLOCK_SIZE during NBD_OPT_GO
api: Add new API to query negotiated block size
nbd...
2020 Sep 07
4
[libnbd PATCH 0/2] Fix memory leak with closures
As promised in my earlier thread on libnbd completion callback question.
Eric Blake (2):
generator: Refactor handling of closures in unlocked functions
generator: Free closures on failure
docs/libnbd.pod | 2 +-
generator/C.ml | 48 +++++++++++------
generator/C.mli | 1 +
lib/debug.c | 7 +--
lib/opt.c | 31 ++++++-----
2019 Jun 29
19
[libnbd PATCH 0/6] new APIs: aio_in_flight, aio_FOO_notify
I still need to wire in the use of *_notify functions into nbdkit to
prove whether it makes the code any faster or easier to maintain, but
at least the added example shows one good use case for the new API.
Eric Blake (6):
api: Add nbd_aio_in_flight
generator: Allow DEAD state actions to run
generator: Allow Int64 in callbacks
states: Prepare for aio notify callback
api: Add new nbd_aio_FOO_notify functions
examples: New example for strict read validations
.gitignore | 1 +
docs/libnbd....