search for: set_debug_callback

Displaying 20 results from an estimated 25 matches for "set_debug_callback".

2019 Jul 11
1
Re: [libnbd] Slight API inconsistency
...n >value influences (whether it is ignored, as in the debug callback, or >whether it controls the use of *error if -1). > Oh, good to know, in that case it should be easy to fix. `void (*` is used in the man pages even for the block_status callback, I think it might be all. Same for the set_debug_callback. One more question then. For callbacks that get saved (i.e. `CallbackPersist`), should the caller take care of figuring out when it will not get called again any more? I am asking regarding the memory deallocation of the opaque pointer. Maybe it is guaranteed that: a) for `aio_*` functions th...
2019 Sep 05
1
Re: [PATCH libnbd] generator: Move first_version fields to a single table.
.../2019-September/msg00020.html > --- > generator/generator | 131 ++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 121 insertions(+), 10 deletions(-) > > +let first_version = [ > + "set_debug", (1, 0); > + "get_debug", (1, 0); > + "set_debug_callback", (1, 0); > + "clear_debug_callback", (1, 0); > + "set_handle_name", (1, 0); > + "get_handle_name", (1, 0); > + "set_export_name", (1, 0); > + "get_export_name", (1, 0); > + "set_tls", (1, 0); > + "get...
2019 Jul 11
2
[libnbd] Slight API inconsistency
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
2019 Sep 05
3
[PATCH libnbd] generator: Move first_version fields to a single table.
This doesn't include Eric's new APIs, but if you push those then I can rebase this one on top. Rich.
2019 Aug 13
0
[PATCH libnbd 1/6] generator: Share single list of all Closures.
...this requires that all Closure args have the same parameter name whichever method they appear in. An alternate refactoring could work the same way as Flags and Enum where the parameter name is part of the arg, eg: type arg = ... | Closure of string * closure (* name, type *) ... "set_debug_callback", { default_call with args = [ Closure ("debug", debug_closure) ]; So after this change, Closure, Flags, and Enum aren't quite congruent. --- generator/generator | 127 ++++++++++++++------------------------------ 1 file changed, 41 insertions(+), 86 deletions(-) diff...
2019 Jul 24
2
Re: [PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...| 3 +- > lib/rw.c | 32 +- > 7 files changed, 364 insertions(+), 446 deletions(-) > > diff --git a/docs/libnbd.pod b/docs/libnbd.pod > index 5608e63..631bb3b 100644 > --- a/docs/libnbd.pod > +++ b/docs/libnbd.pod > @@ -487,8 +487,7 @@ C<nbd_set_debug_callback>, C<nbd_pread_callback>). Libnbd can call > these functions while processing. > > Callbacks have an opaque C<void *user_data> pointer. This is passed Should we tweak this to explicitly call out "Callbacks in the C language", to differentiate it from bindings...
2019 Sep 05
0
[PATCH libnbd] generator: Move first_version fields to a single table.
...t;]; }; +] +(* The first stable version that the symbol appeared in, for + * example (1, 2) if the symbol was added in development cycle + * 1.1.x and thus the first stable version was 1.2. + *) +let first_version = [ + "set_debug", (1, 0); + "get_debug", (1, 0); + "set_debug_callback", (1, 0); + "clear_debug_callback", (1, 0); + "set_handle_name", (1, 0); + "get_handle_name", (1, 0); + "set_export_name", (1, 0); + "get_export_name", (1, 0); + "set_tls", (1, 0); + "get_tls", (1, 0); + "set_tl...
2019 Jul 24
0
Re: [PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...| 32 +- > > 7 files changed, 364 insertions(+), 446 deletions(-) > > > > diff --git a/docs/libnbd.pod b/docs/libnbd.pod > > index 5608e63..631bb3b 100644 > > --- a/docs/libnbd.pod > > +++ b/docs/libnbd.pod > > @@ -487,8 +487,7 @@ C<nbd_set_debug_callback>, C<nbd_pread_callback>). Libnbd can call > > these functions while processing. > > > > Callbacks have an opaque C<void *user_data> pointer. This is passed > > Should we tweak this to explicitly call out "Callbacks in the C > language", to...
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 Aug 13
12
[PATCH 0/6] Implement OClosure.
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. 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
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...cbargs : arg list; (* all closures return int for now *) +} and ret = | RBool (* return a boolean, or error *) | RConstString (* return a const string, NULL for error *) @@ -915,9 +920,9 @@ Return the state of the debug flag on this handle."; "set_debug_callback", { default_call with - args = [ Opaque "data"; - CallbackPersist ("debug_fn", [Opaque "data"; - String "context"; String "msg"]) ]; + args = [ Closure (true, +...
2019 Jul 16
1
Re: [PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...be done on top, if at all. > +} > and ret = > | RBool (* return a boolean, or error *) > | RConstString (* return a const string, NULL for error *) > @@ -915,9 +920,9 @@ Return the state of the debug flag on this handle."; > > "set_debug_callback", { > default_call with > - args = [ Opaque "data"; > - CallbackPersist ("debug_fn", [Opaque "data"; > - String "context"; String "msg"]) ]; > + args = [ Closure (t...
2019 Aug 03
1
[PATCH libnbd] generator: Generate typedefs automatically for Closure arguments.
...fined explicitly inside the function parameters. This commit defines a new public typedef: typedef int (*nbd_debug_callback) (unsigned valid_flag, void *user_data, 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 necessitate...
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 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 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...+| CBUInt64 of string (* like UInt64 *) and permitted_state = | Created (* can be called in the START state *) | Connecting (* can be called when connecting/handshaking *) @@ -932,7 +939,7 @@ Return the state of the debug flag on this handle."; "set_debug_callback", { default_call with args = [ Closure { cbname="debug"; - cbargs=[String "context"; String "msg"] } ]; + cbargs=[CBString "context"; CBString "msg"] } ]; ret = RErr; shortdesc = &...
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...* persists *) | Path of string (* filename or path *) | SockAddrAndLen of string * string (* struct sockaddr * + socklen_t *) | String of string (* string *) @@ -915,9 +923,10 @@ Return the state of the debug flag on this handle."; "set_debug_callback", { default_call with - args = [ Opaque "data"; - CallbackPersist ("debug_fn", [Opaque "data"; - String "context"; String "msg"]) ]; + args = [ OpaqueAndCallbacksPersist ("da...
2019 Jul 24
0
[PATCH libnbd 2/3] lib: Implement closure lifetimes.
...s callback will never be needed or called again), it is called once more with valid_flag == LIBNBD_CALLBACK_FREE. (Note it is also possible for the library to call the callback with valid_flag == LIBNBD_CALLBACK_VALID|LIBNBD_CALLBACK_FREE, meaning it's the last valid call.) As an example, nbd_set_debug_callback registers a debug closure which is saved in the handle. The closure is freed either when nbd_set_debug_callback is called again, or the handle is closed. The sequence of events would look like this: Caller Callback nbd_set_debug_callback # a new deb...
2019 Jul 16
3
[RFC libnbd PATCH 0/2] Start fixing python nbd.pread_structured_callback
Posting now that I got something to compile (at the expense of breaking OCaml bindings), but I'm open to ideas on how to improve it. Eric Blake (2): generator: Tweak print_c_arg_list to take alternate first arg RFC: generator: Handle shared callbacks in Python generator/generator | 556 ++++++++++++++++++++++---------------------- 1 file changed, 280 insertions(+), 276 deletions(-) --
2019 Jul 24
0
[PATCH libnbd v2 2/5] lib: Implement closure lifetimes.
...s callback will never be needed or called again), it is called once more with valid_flag == LIBNBD_CALLBACK_FREE. (Note it is also possible for the library to call the callback with valid_flag == LIBNBD_CALLBACK_VALID|LIBNBD_CALLBACK_FREE, meaning it's the last valid call.) As an example, nbd_set_debug_callback registers a debug closure which is saved in the handle. The closure is freed either when nbd_set_debug_callback is called again, or the handle is closed. The sequence of events would look like this: Caller Callback nbd_set_debug_callback # a new deb...