[Libguestfs] [PATCH libnbd v2 10/10] generator: Check requirements for BytesPersistIn/Out and completion callbacks.

Eric Blake eblake at redhat.com
Thu Aug 15 12:01:49 UTC 2019


On 8/15/19 4:56 AM, Richard W.M. Jones wrote:
> ---
>  generator/generator | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/generator/generator b/generator/generator
> index 1252bdb..13cb0b9 100755
> --- a/generator/generator
> +++ b/generator/generator
> @@ -3121,6 +3121,31 @@ let () =
>          failwithf "%s: first_version must be 1.x" name;
>        if minor mod 2 <> 0 then
>          failwithf "%s: first_version must refer to a stable release" name
> +  ) handle_calls;
> +
> +  (* Because of the way we use completion free callbacks to
> +   * free persistent buffers in non-C languages, any function
> +   * with a BytesPersistIn/Out parameter must have only one.
> +   * And it must have an OClosure completion optarg.
> +   *)

I like it.  Other than the unintended semantic change in patch 4, I
think this series is ready to go.

We still had another potential API change to squeeze into 0.9.8:
Right now, the API is overloading 'command':
nbd_connect_command/nbd_kill_command
vs.
nbd_aio_command_completed/nbd_aio_peek_command_completed

Keeping nbd_connect_command may be okay (it takes a command line to
create a subprocess), but we may want to rename nbd_kill_command to
nbd_kill_child or similar, to make it obvious that it is NOT associated
with attempting an early abort of any synchronous nbd_pread or other
commands issued to the server.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190815/d0383002/attachment.sig>


More information about the Libguestfs mailing list