[Libguestfs] [nbdkit PATCH v3 12/16] filters: New API for plugin context management
Eric Blake
eblake at redhat.com
Tue Mar 9 18:06:31 UTC 2021
On 3/5/21 5:31 PM, Eric Blake wrote:
> As promised in an earlier patch, get rid of the temporary
> nbdkit_backend_reopen, and replace it with the finer-grained
> combination of nbdkit_context_get_backend, nbdkit_context_next_open,
> nbdkit_context_next_close, and nbdkit_context_set_next. Update the
I'm updating this commit message to match the actual API names in the
patch body.
> retry filter to use the new API. Change the (temporary) preprocessor
> guard from NBDKIT_RETRY_FILTER to NBDKIT_TYPESAFE (will be dropped
> later once more filters are converted). Drop the now-unused
> backend_reopen() function. Expose .prepare and .finalize callbacks
> into struct nbdkit_next_ops for use during manual context
> manipulation.
>
> With this in place, it is now possible for a filter to open more than
> one context into the backend from a single connection (shown here in
> the retry filter), and conversely to share a single backend context
> across multiple connections (an upcoming patch will demonstrate this
> in the ext2 filter, although TODO mentions a few more steps we need to
> get there).
> ---
> +
> +=head3 C<nbdkit_context_get_backend>
> +
> +=head3 C<nbdkit_next_context_open>
> +
> +=head3 C<nbdkit_next_context_close>
> +
> +=head3 C<nbdkit_context_set_next>
> +
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
More information about the Libguestfs
mailing list