search for: cc_next

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

Did you mean: cc_kext
2019 Jul 25
0
[PATCH libnbd v3 2/2] lib: Remove nbd_add_close_callback.
...allback cb, void *user_data); - "; pr "=head1 API CALLS\n"; diff --git a/lib/handle.c b/lib/handle.c index 6f5a4d6..840702a 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -90,7 +90,6 @@ nbd_create (void) void nbd_close (struct nbd_handle *h) { - struct close_callback *cc, *cc_next; struct meta_context *m, *m_next; if (h == NULL) @@ -100,12 +99,6 @@ nbd_close (struct nbd_handle *h) if (h->debug_fn) h->debug_fn (LIBNBD_CALLBACK_FREE, h->debug_data, NULL, NULL); - for (cc = h->close_callbacks; cc != NULL; cc = cc_next) { - cc_next = cc->next...
2019 Jul 25
4
[PATCH libnbd v3 0/2] lib: Implement closure lifetimes.
I think I've addressed everything that was raised in review. Some of the highlights: - Callbacks should be freed reliably along all exit paths. - There's a simple test of closure lifetimes. - I've tried to use VALID|FREE in all the places where I'm confident that it's safe and correct to do. There may be more places. Note this is an optimization and shouldn't
2019 Jul 16
2
[PATCH libnbd] generator: Define new Closure type
** INCOMPLETE ** This is the generator change as discussed on the list already. The Python and OCaml bindings are not yet done. It passes all [C only] tests and valgrind. Note that nbd_add_close_callback is inconsistent with other closure types because it passes the user_data parameter after the function. (This is not caused by the current patch, it was already inconsistent). We decided that
2019 Jul 25
0
[PATCH libnbd v3 1/2] lib: Implement closure lifetimes.
...e_command (cmd); } } @@ -96,6 +96,10 @@ nbd_close (struct nbd_handle *h) if (h == NULL) return; + /* Free user callbacks first. */ + if (h->debug_fn) + h->debug_fn (LIBNBD_CALLBACK_FREE, h->debug_data, NULL, NULL); + for (cc = h->close_callbacks; cc != NULL; cc = cc_next) { cc_next = cc->next; cc->cb (cc->user_data); diff --git a/lib/internal.h b/lib/internal.h index 993075a..75f1b89 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -48,6 +48,7 @@ struct meta_context; struct close_callback; struct socket; struct command; +typedef int (*debug...
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...amp;& error) cmd->error = error; } if (cmd->error == 0) diff --git a/lib/handle.c b/lib/handle.c index cbe7e8a..5003227 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -98,7 +98,7 @@ nbd_close (struct nbd_handle *h) for (cc = h->close_callbacks; cc != NULL; cc = cc_next) { cc_next = cc->next; - cc->cb (cc->data); + cc->cb (cc->user_data); free (cc); } @@ -202,7 +202,8 @@ nbd_unlocked_add_meta_context (struct nbd_handle *h, const char *name) * programming languages. */ int -nbd_add_close_callback (struct nbd_handle *h, nbd_c...
2019 Jul 25
4
Re: [PATCH libnbd v3 1/2] lib: Implement closure lifetimes.
...10 @@ nbd_close (struct nbd_handle *h) > if (h == NULL) > return; > > + /* Free user callbacks first. */ > + if (h->debug_fn) > + h->debug_fn (LIBNBD_CALLBACK_FREE, h->debug_data, NULL, NULL); > + > for (cc = h->close_callbacks; cc != NULL; cc = cc_next) { I recommend either setting h->debug_fn = NULL here, or deferring the FREE callback to after the h->sock->ops->close (h->sock) below. Otherwise, a future edit to lib/sockets.c to add in a debug statement there will cause a use-after-free at a distance. > +++ b/tests/closure-li...
2019 Jul 16
2
[PATCH libnbd v2] generator: Define new Closure type
As before, but this one has working Python bindings. OCaml still TBD. Rich.
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