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 (3): api: Add get_nr_meta_contexts, clear_meta_contexts generator: Rename OPT_SET_META_CONTEXT states api: Add nbd_opt_list_meta_context lib/internal.h | 1 + generator/API.ml | 162 +++++++++++++++++- generator/Makefile.am | 4 +- generator/state_machine.ml | 6 +- ...t.c => states-newstyle-opt-meta-context.c} | 106 ++++++++---- .../states-newstyle-opt-structured-reply.c | 4 +- generator/states-newstyle.c | 5 +- lib/handle.c | 32 ++++ lib/opt.c | 73 ++++++++ tests/meta-base-allocation.c | 36 +++- TODO | 11 ++ 11 files changed, 394 insertions(+), 46 deletions(-) rename generator/{states-newstyle-opt-set-meta-context.c => states-newstyle-opt-meta-context.c} (66%) -- 2.28.0