[Libguestfs] [PATCH libnbd v2 4/5] docs: callbacks: Document that user_data, valid_flag only used by the C API.
Richard W.M. Jones
rjones at redhat.com
Wed Jul 24 16:54:42 UTC 2019
Thanks: Eric Blake.
---
docs/libnbd.pod | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/docs/libnbd.pod b/docs/libnbd.pod
index 0ce4d32..6c8d962 100644
--- a/docs/libnbd.pod
+++ b/docs/libnbd.pod
@@ -487,7 +487,9 @@ 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
-as the second parameter to the callback.
+as the second parameter to the callback. The opaque pointer is only
+used from the C API, since in other languages you can use closures to
+achieve the same outcome.
=head2 Callback lifetimes
@@ -539,6 +541,9 @@ write this:
// Rest of callback as normal.
}
+The valid flag is only present in the C API. It is not needed when
+using garbage-collected programming languages.
+
=head2 Callbacks and locking
The callbacks are invoked at a point where the libnbd lock is held; as
--
2.22.0
More information about the Libguestfs
mailing list