[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH libnbd] generator: Swap parameters of nbd_add_close_callback.



On 7/16/19 10:39 AM, Eric Blake wrote:
> On 7/16/19 10:04 AM, Richard W.M. Jones wrote:
>> The API changes from:
>>
>>   int nbd_add_close_callback (struct nbd_handle *h,
>>                               nbd_close_callback cb,
>>                               void *user_data);
>>
>> to:
>>
>>   int nbd_add_close_callback (struct nbd_handle *h,
>>                               void *user_data,
>>                               nbd_close_callback cb);
>>
>> The second way is consistent with how other callbacks work throughout
>> the API (ie. having the user_data passed first).
>> ---
>>  generator/generator | 10 +++++-----
>>  lib/handle.c        |  2 +-
>>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> ACK.
> 

A bit of bike-shedding:

In libc, we have qsort_r() which takes the function pointer before the
opaque data.

I'm trying to find other common frameworks that have common Closure
conventions, to see if we should instead swap our nbd_aio_FOO functions
to take user_data after the function pointers, instead of this switch to
the nbd_add_close_callback parameter order.


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

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]