[Libguestfs] [PATCH libnbd 1/6] generator: Share single list of all Closures.

Eric Blake eblake at redhat.com
Tue Aug 13 11:12:26 UTC 2019


On 8/13/19 5:06 AM, Richard W.M. Jones wrote:
> This change does not affect the output of the generator.
> 
> Note this requires that all Closure args have the same parameter name
> whichever method they appear in.  An alternate refactoring could work
> the same way as Flags and Enum where the parameter name is part of the
> arg, eg:
> 
>   type arg =
>   ...
>   | Closure of string * closure   (* name, type *)
>   ...
>   "set_debug_callback", {
>     default_call with
>     args = [ Closure ("debug", debug_closure) ];
> 
> So after this change, Closure, Flags, and Enum aren't quite congruent.

But the difference isn't too bad.

> ---
>  generator/generator | 127 ++++++++++++++------------------------------
>  1 file changed, 41 insertions(+), 86 deletions(-)

The diffstat shows this is a win.

ACK

-- 
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/20190813/c724a327/attachment.sig>


More information about the Libguestfs mailing list