Fix some things I noticed while reviewing v1, and follow Rich's idea to add a new nbdkit_set_error() utility function with a binding for Python users to request a particular error (rather than being forced to live with whatever stale value is in errno after all the intermediate binding glue code).
I could not easily find out how to register a C function callable from perl bindings, and have not got enough experience with Ruby or Ocaml (those will probably require me to do lots of copy-and-paste and language learning), but if the code looks good for python, I suspect the other languages will take a similar approach. Maybe we want to also make nbdkit.error() and nbdkit.debug() callable from Python (so that we have a more complete binding of all the utility functions that C plugins can use); this can be used as a starting point for that. Eric Blake (6): file: Optimize writing zeroes without holes protocol: Map EROFS to EPERM protocol: Support ESHUTDOWN error plugins: Add new nbdkit_set_error() utility function python: Expose nbdkit_set_error to python script python: Support zero callback docs/nbdkit-plugin.pod | 16 +++++++-- include/nbdkit-plugin.h | 3 +- plugins/file/file.c | 19 +++++++--- plugins/python/example.py | 11 ++++++ plugins/python/nbdkit-python-plugin.pod | 47 +++++++++++++++++++++--- plugins/python/python.c | 64 +++++++++++++++++++++++++++++++++ src/connections.c | 37 +++++++++++++++---- src/errors.c | 6 ++++ src/internal.h | 2 ++ src/plugins.c | 10 ++++-- src/protocol.h | 1 + src/tls.c | 28 +++++++++++++-- 12 files changed, 221 insertions(+), 23 deletions(-) -- 2.9.3 _______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs