[Libguestfs] [PATCH 0/6] Implement OClosure.

Eric Blake eblake at redhat.com
Tue Aug 13 11:50:33 UTC 2019


On 8/13/19 5:06 AM, Richard W.M. Jones wrote:
> Patches 1-4 are basically uncontroversial, straightforward refactoring
> and IMHO we should just push them.  Possibly 1-3 should be squashed
> together, but I posted them separately so they are easier to review.

Agreed.

> 
> Patches 5 and 6 together implement OClosure.  Patch 5 adds the feature
> and is simple to understand.
> 
> Patch 6 changes the Closure completion callbacks into OClosure, but
> because it doesn't change the position within the list of arguments
> the C API doesn't change at all.  The Python API also doesn't change
> for the same reason.  (The OCaml API _does_ change but not
> significantly).
> 
> I've run out of time on this patch today because I've got meetings for
> the rest of the day (and it's only 11am!)  However if I did have more
> time there would be a 7th patch in the series which renames all
> aio_*_callback functions to simply aio_*.  eg. nbd_aio_pread_callback
> is renamed to nbd_aio_pread (and old nbd_aio_pread is removed).  That
> is obviously a somewhat large albeit it mechanical API change.

Then from there, we move on to a patch that changes Closure/OClosure to
switch the C bindings from 2-tuple to 3-tuple, where you provide a
separate free_fn to be called at the end-of-lifetime instead of the
current valid_flags parameter to the single function.

I'm liking the way this is headed, even though it is a big API/ABI
change to async users.

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


More information about the Libguestfs mailing list