search for: callback_user_data

Displaying 9 results from an estimated 9 matches for "callback_user_data".

2019 Aug 03
1
[PATCH libnbd] generator: Generate typedefs automatically for Closure arguments.
...ata, const char *context, const char *msg); and then uses the typedef like this: extern int nbd_set_debug_callback (struct nbd_handle *h, nbd_debug_callback debug_callback, void *debug_callback_user_data); (Previously typedefs were available, but they were written by hand and only used internally to the library.) This change necessitates that we uniquely name all of our closures across methods (the same-named closure is required to have the same cbargs). I took this opportunity to rename some, s...
2019 Jul 22
1
Re: [libnbd] More thoughts on callbacks and more
This has an annoying subtlety around the fact that we can pass a single user_data and multiple closures in one function call. The LIBNBD_CALLBACK_FREE function would be called several times with the same user_data in this case, which means the callback must do some kind of reference counting before the user_data can be freed. I propose that we split up Closure so it describes a single closure,
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...nbd_chunk_callback chunk, void *user_data, + nbd_chunk_callback chunk, + void *read_user_data, + nbd_completion_callback completion, + void *callback_user_data, uint32_t flags) -{ - return nbd_unlocked_aio_pread_structured_callback (h, buf, count, offset, - chunk, user_data, - NULL, NULL, -...
2019 Aug 13
2
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
This applies on top of the OClosure v2 series posted a few minutes ago. Rich.
2019 Aug 13
0
[PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
...size_t count, uint64_t offset, nbd_chunk_callback chunk, - void *read_user_data, nbd_completion_callback completion, - void *callback_user_data, uint32_t flags) { struct command_cb cb = { .fn.chunk = chunk, - .fn_user_data = read_user_data, - .completion = completion, - .user_data = callback_user_data, }; +...
2019 Jul 24
0
[PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...void *user_data, uint32_t flags) + read_fn read, + void *read_user_data, + callback_fn callback, + void *callback_user_data, + uint32_t flags) { - struct command_cb cb = { .fn.read = read, .callback = callback, - .user_data = user_data, }; + struct command_cb cb = { .fn.read = read, + .fn_user_data = read_user_data, +...
2019 Jul 24
8
[PATCH libnbd v2 0/5] lib: Implement closure lifetimes.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-July/thread.html#00231 The changes address everything that Eric picked up in his review of the first two patches. I have also added two more patches (4 and 5) which respectively fix docs and change int status -> unsigned status, as discussed. Passes make, check, check-valgrind. Rich.
2019 Jul 24
6
[PATCH libnbd 0/3] Implement closure lifetimes.
This implements most of what I wrote here: https://www.redhat.com/archives/libguestfs/2019-July/msg00213.html
2019 Aug 13
8
[PATCH libnbd 0/4] Add free function to callbacks.
Patches 1 & 2 are rather complex, but the end result is that we pass closures + user_data + free function in single struct parameters as I described previously in this email: https://www.redhat.com/archives/libguestfs/2019-August/msg00210.html Patch 3 adds a convenient FREE_CALLBACK macro which seems a worthwhile simplification if you buy into 1 & 2. Patch 4 adds another macro which is