search for: list_cb

Displaying 7 results from an estimated 7 matches for "list_cb".

2020 Sep 07
0
[libnbd PATCH 2/2] generator: Free closures on failure
...; + assert (completion_cb_freed == 1); + + nbd_kill_subprocess (nbd, 0); + nbd_close (nbd); + exit (EXIT_SUCCESS); } diff --git a/tests/newstyle-limited.c b/tests/newstyle-limited.c index fd89620..4479a14 100644 --- a/tests/newstyle-limited.c +++ b/tests/newstyle-limited.c @@ -84,6 +84,17 @@ list_cb (void *opaque, const char *name, const char *description) exit (EXIT_FAILURE); } +static bool list_freed = false; +static void +free_list_cb (void *opaque) +{ + if (list_freed) { + fprintf (stderr, "%s: list callback mistakenly freed twice", progname); + exit (EXIT_FAILURE); +...
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
2020 Sep 07
4
[libnbd PATCH 0/2] Fix memory leak with closures
As promised in my earlier thread on libnbd completion callback question. Eric Blake (2): generator: Refactor handling of closures in unlocked functions generator: Free closures on failure docs/libnbd.pod | 2 +- generator/C.ml | 48 +++++++++++------ generator/C.mli | 1 + lib/debug.c | 7 +-- lib/opt.c | 31 ++++++-----
2020 Aug 14
0
[libnbd PATCH v2 11/13] api: Add nbd_aio_opt_list
...t;option queued, ignoring state machine failure"); + return 0; +} diff --git a/tests/newstyle-limited.c b/tests/newstyle-limited.c index f2f1cba..ab6c1c2 100644 --- a/tests/newstyle-limited.c +++ b/tests/newstyle-limited.c @@ -76,6 +76,14 @@ pread_cb (void *data, return 0; } +static int +list_cb (void *opaque, const char *name, const char *descriptiong) +{ + /* This callback is unreachable; plain newstyle can't do OPT_LIST */ + fprintf (stderr, "%s: list callback mistakenly reached", progname); + exit (EXIT_FAILURE); +} + int main (int argc, char *argv[]) { @@ -136,7 +1...
2020 Aug 18
0
[libnbd PATCH v3 2/2] api: Add nbd_aio_opt_list
...uot;); + assert (!exports = [ "a" ]); NBD.opt_abort nbd diff --git a/tests/newstyle-limited.c b/tests/newstyle-limited.c index f2f1cba..ab6c1c2 100644 --- a/tests/newstyle-limited.c +++ b/tests/newstyle-limited.c @@ -76,6 +76,14 @@ pread_cb (void *data, return 0; } +static int +list_cb (void *opaque, const char *name, const char *descriptiong) +{ + /* This callback is unreachable; plain newstyle can't do OPT_LIST */ + fprintf (stderr, "%s: list callback mistakenly reached", progname); + exit (EXIT_FAILURE); +} + int main (int argc, char *argv[]) { @@ -136,7 +1...
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):