Displaying 19 results from an estimated 19 matches for "call_callback".
Did you mean:
sasl_callback
2019 Aug 13
0
[PATCH libnbd 4/4] lib: Add CALL_CALLBACK macro.
...cmd->error == 0);
- if (cmd->cb.fn.chunk.callback (cmd->cb.fn.chunk.user_data,
- cmd->data, cmd->count,
- cmd->offset, LIBNBD_READ_DATA,
- &error) == -1)
+ if (CALL_CALLBACK (cmd->cb.fn.chunk,
+ cmd->data, cmd->count,
+ cmd->offset, LIBNBD_READ_DATA,
+ &error) == -1)
cmd->error = error ? error : EPROTO;
FREE_CALLBACK (cmd->cb.fn.chunk);
}
diff --git a/gene...
2019 Aug 14
2
[libnbd PATCH] lib: Consolidate free callbacks to just happen at retire time
...| 11 ++++++-----
lib/debug.c | 4 +++-
7 files changed, 10 insertions(+), 42 deletions(-)
diff --git a/lib/internal.h b/lib/internal.h
index dc3676a..1971613 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -277,20 +277,6 @@ struct command {
#define CALL_CALLBACK(cb, ...) \
(cb).callback ((cb).user_data, ##__VA_ARGS__)
-/* Free a callback.
- *
- * Note this works for any type of callback because the basic layout
- * of the struct is the same for all of them. Therefore casting cb to
- * nbd_completion_callback does not change the effective code.
- */
-#...
2019 Aug 15
0
Re: [libnbd PATCH] lib: Consolidate free callbacks to just happen at retire time
.../debug.c | 4 +++-
> 7 files changed, 10 insertions(+), 42 deletions(-)
>
> diff --git a/lib/internal.h b/lib/internal.h
> index dc3676a..1971613 100644
> --- a/lib/internal.h
> +++ b/lib/internal.h
> @@ -277,20 +277,6 @@ struct command {
> #define CALL_CALLBACK(cb, ...) \
> (cb).callback ((cb).user_data, ##__VA_ARGS__)
>
> -/* Free a callback.
> - *
> - * Note this works for any type of callback because the basic layout
> - * of the struct is the same for all of them. Therefore casting cb to
> - * nbd_completion_callback does not...
[PATCH libnbd v2 02/10] lib: Add macros to check if a callback is "null" or not, and set it to null.
2019 Aug 15
0
[PATCH libnbd v2 02/10] lib: Add macros to check if a callback is "null" or not, and set it to null.
...the callback about the
@@ -385,7 +386,7 @@
offset = be64toh (h->sbuf.sr.payload.offset_data.offset);
assert (cmd); /* guaranteed by CHECK */
- if (cmd->cb.fn.chunk.callback) {
+ if (CALLBACK_IS_NOT_NULL (cmd->cb.fn.chunk)) {
int error = cmd->error;
if (CALL_CALLBACK (cmd->cb.fn.chunk, cmd->data + (offset - cmd->offset),
@@ -446,7 +447,7 @@
* them as an extension, and this works even when length == 0.
*/
memset (cmd->data + offset, 0, length);
- if (cmd->cb.fn.chunk.callback) {
+ if (CALLBACK_IS_NOT_NULL (cmd->cb.fn.chun...
2019 Aug 15
13
[PATCH libnbd v2 00/10] Callbacks and OCaml and Python persistent buffers.
This is a combination of these two earlier series:
https://www.redhat.com/archives/libguestfs/2019-August/msg00235.html
https://www.redhat.com/archives/libguestfs/2019-August/msg00240.html
plus changes to allow .callback = NULL / .free != NULL, and to reduce
the complexity of freeing callbacks.
Although it's rather long there's nothing complex here. We might
consider squashing some
2019 Aug 15
0
[PATCH libnbd v2 04/10] lib: Permit .callback = NULL, .free != NULL.
...K_IS_NULL(cb) ((cb).callback == NULL && (cb).free == NULL)
#define CALLBACK_IS_NOT_NULL(cb) (! CALLBACK_IS_NULL ((cb)))
-#define SET_CALLBACK_TO_NULL(cb) ((cb).callback = NULL)
+#define SET_CALLBACK_TO_NULL(cb) ((cb).callback = NULL, (cb).free = NULL)
/* Call a callback. */
-#define CALL_CALLBACK(cb, ...) \
- (cb).callback ((cb).user_data, ##__VA_ARGS__)
+#define CALL_CALLBACK(cb, ...) \
+ ((cb).callback != NULL ? (cb).callback ((cb).user_data, ##__VA_ARGS__) : 0)
/* Free a callback. */
-#define FREE_CALLBACK(cb)...
2020 Sep 28
0
[libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context
...->sbuf.or.option_reply.reply);
len = be32toh (h->sbuf.or.option_reply.replylen);
switch (reply) {
case NBD_REP_ACK: /* End of list of replies. */
- SET_NEXT_STATE (%^OPT_GO.START);
+ if (opt == NBD_OPT_LIST_META_CONTEXT) {
+ SET_NEXT_STATE (%.NEGOTIATING);
+ CALL_CALLBACK (h->opt_cb.completion, &err);
+ nbd_internal_free_option (h);
+ }
+ else
+ SET_NEXT_STATE (%^OPT_GO.START);
break;
case NBD_REP_META_CONTEXT: /* A context. */
if (len > maxpayload)
@@ -194,21 +225,38 @@ STATE_MACHINE {
}
debug (h, "negotiat...
2023 Aug 04
2
[libnbd PATCH v4 01/25] block_status: Add some sanity checking of server lengths
...lock descriptors;
> - * see _block_desc_is_multiple_of_bs_entry above.
> - */
> - for (i = 0; i < h->bs_count * 2; ++i)
> - h->bs_entries[i] = be32toh (h->bs_entries[i]);
> -
> - /* Call the caller's extent function. */
> - if (CALL_CALLBACK (cmd->cb.fn.extent, name, cmd->offset,
> - h->bs_entries, h->bs_count * 2, &error) == -1)
> - if (cmd->error == 0)
> - cmd->error = error ? error : EPROTO;
> - }
> - else
> + SET_NEXT_STATE (%FINISH);
> +...
2020 Sep 28
8
[libnbd PATCH 0/3] opt_list_meta_context
I'm posting this now, as I'm at the end of a workday and I got things
working for manual experimentation.
Still to do:
- write interop tests for qemu-nbd and nbdkit (including my proposed
patch addition of qemu-nbd -A to show qemu:allocation-depth)
- figure out if we can make 'nbdinfo --map' use the new API to
automatically select all contexts advertised by the server
Eric Blake
2019 Aug 15
2
Re: [PATCH libnbd v2 04/10] lib: Permit .callback = NULL, .free != NULL.
...t care whether both pointers are NULL.
> #define CALLBACK_IS_NOT_NULL(cb) (! CALLBACK_IS_NULL ((cb)))
> -#define SET_CALLBACK_TO_NULL(cb) ((cb).callback = NULL)
> +#define SET_CALLBACK_TO_NULL(cb) ((cb).callback = NULL, (cb).free = NULL)
>
> /* Call a callback. */
> -#define CALL_CALLBACK(cb, ...) \
> - (cb).callback ((cb).user_data, ##__VA_ARGS__)
> +#define CALL_CALLBACK(cb, ...) \
> + ((cb).callback != NULL ? (cb).callback ((cb).user_data, ##__VA_ARGS__) : 0)
This one is nice, though.
>
> /* Free a callback. */
> -...
2005 Jan 15
0
ppp connection only every second time
...0:32 waltz pptp[723]: anon log[ctrlp_disp:pptp_ctrl.c:912]: Call disconnect notification received (call id 0)
Jan 15 14:00:32 waltz pptp[723]: anon log[ctrlp_error:pptp_ctrl.c:195]: Result code is 4 '(your) Request'. Error code is 0, Cause code is 0
Jan 15 14:00:32 waltz pptp[723]: anon log[call_callback:pptp_callmgr.c:77]: Closing connection
Jan 15 14:00:32 waltz pppd[724]: Hangup (SIGHUP)
Jan 15 14:00:32 waltz pppd[724]: Modem hangup
Jan 15 14:00:32 waltz pppd[724]: Connect time 1.3 minutes.
Jan 15 14:00:32 waltz pppd[724]: Sent 320 bytes, received 380 bytes.
Jan 15 14:00:32 waltz pppd[724]: Conn...
2020 Aug 14
0
[libnbd PATCH v2 11/13] api: Add nbd_aio_opt_list
...e don't receive unlimited amounts
- * of data from the server. Note each export name can be
- * up to 4K.
- */
- if (h->nr_exports > 10000) {
- set_error (0, "too many export names sent by the server");
- SET_NEXT_STATE (%.DEAD);
- return 0;
+ CALL_CALLBACK (h->opt_cb.fn.list, name, desc);
+ free (tmp);
}
/* Wait for more replies. */
@@ -131,19 +117,23 @@ STATE_MACHINE {
case NBD_REP_ACK:
/* Finished receiving the list. */
- SET_NEXT_STATE (%.NEGOTIATING);
- return 0;
+ err = 0;
+ break;
default:
if (ha...
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
2020 Aug 18
0
[libnbd PATCH v3 2/2] api: Add nbd_aio_opt_list
...e don't receive unlimited amounts
- * of data from the server. Note each export name can be
- * up to 4K.
- */
- if (h->nr_exports > 10000) {
- set_error (0, "too many export names sent by the server");
- SET_NEXT_STATE (%.DEAD);
- return 0;
+ CALL_CALLBACK (h->opt_cb.fn.list, name, desc);
+ free (tmp);
}
/* Wait for more replies. */
@@ -131,19 +117,23 @@ STATE_MACHINE {
case NBD_REP_ACK:
/* Finished receiving the list. */
- SET_NEXT_STATE (%.NEGOTIATING);
- return 0;
+ err = 0;
+ break;
default:
if (ha...
2020 Aug 14
0
[libnbd PATCH v2 12/13] wip: api: Give aio_opt_go a completion callback
...INE {
reply);
}
nbd_internal_reset_size_and_flags (h);
- if (h->opt_mode)
- SET_NEXT_STATE (%.NEGOTIATING);
- else
- SET_NEXT_STATE (%^PREPARE_OPT_ABORT);
+ err = nbd_get_errno ();
break;
case NBD_REP_ACK:
+ err = 0;
+ break;
+ }
+
+ CALL_CALLBACK (h->opt_cb.completion, &err);
+ nbd_internal_free_option (h);
+ if (err == 0)
SET_NEXT_STATE (%^FINISHED);
- break;
- }
+ else if (h->opt_mode)
+ SET_NEXT_STATE (%.NEGOTIATING);
+ else
+ SET_NEXT_STATE (%^PREPARE_OPT_ABORT);
return 0;
} /* END STATE MACHINE */
diff...
2020 Oct 02
4
[libnbd PATCH v2 0/2] opt_list_meta_context
In v2: ack'ed preliminary patches have been pushed, and I've added a
lot of testsuite coverage as well as putting the new API to use in
nbdinfo.
Eric Blake (2):
api: Add nbd_opt_list_meta_context
info: List available meta-contexts
lib/internal.h | 1 +
generator/API.ml | 84 ++++++++-
2020 Aug 18
3
[libnbd PATCH v3 0/2] Implementing NBD_OPT_LIST
This is a subset of my v2 posting, but limited to just the
NBD_OPT_LIST handling. The biggest change since v2 is the addition of
added unit testing in all four language bindings (C, python, ocaml,
golang). The tests require nbdkit built from git on PATH, and may not
be entirely idiomatic, but I at least validated that they catch issues
(for example, adding an exit statement near the end of the
2020 Aug 14
18
[libnbd PATCH v2 00/13] Adding nbd_set_opt_mode to improve nbdinfo
Well, I'm not quite done (I still want to get nbdinfo to work on a
single nbd connection for all cases when reading the heads of the
file is not required), but I'm happy with patches 1-11, and 12-13
show where I'm headed for getting NBD_OPT_INFO to work. Posting
now to see if some of the earlier patches are ready to commit while
I continue working on the latter half.
Eric Blake (13):
2023 Jul 13
2
[libnbd PATCH 0/2] Fix docs and testing of completion callback
This is my proposal for fixing the documentation to match practice
(namely, that completion.callback is not invoked in the cases where
the aio call itself reports errors); we could instead try to go the
other direction and tweak the generator to guarantee that both
completion.callback and completion.free are reached no matter what,
but that felt more invasive to me.
Eric Blake (2):
api: Tighten