[Libguestfs] [libnbd] Slight API inconsistency

Martin Kletzander mkletzan at redhat.com
Thu Jul 11 14:23:22 UTC 2019


The callback (e.g. for `nbd_block_status`) now has a support for returning
errors thanks to the last parameter (`int *error`), so it was switched to
returning void.  But that was not switched everywhere and some code expects it
to return `int`.  Yet another inconsistency is in the debug callback, which is
supposed to return `void`, I guess, but due to the way the generator is
implemented it's defined to return `int` instead.

So my question is, should all callbacks just return nothing and if there is a
need for some information to get back they will just use a pointer to some data
(like with the `int *error`)?  Or do we need different return types for
callbacks and should `Callback` and `CallbackPersist` be defined as:
`string * arg list * ret` ?

Have a nice day,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190711/9a6a2f10/attachment.sig>


More information about the Libguestfs mailing list