Displaying 20 results from an estimated 21 matches for "nbd_pread_callback".
2019 Jun 18
0
[libnbd PATCH 6/8] states: Add nbd_pread_callback API
...ue a read command to the NBD server for the range starting
at C<offset> and ending at C<offset> + C<count> - 1. NBD
can only read all or nothing using this call. The call
returns when the data has been read fully into C<buf> or there is an
-error.
+error. See also C<nbd_pread_callback>, if finer visibility is
+required into the server's replies.
+
+The C<flags> parameter must be C<0> for now (it exists for future NBD
+protocol extensions).";
+ };
+
+ "pread_callback", {
+ default_call with
+ args = [ BytesOut ("buf", "coun...
2019 Jun 20
1
Re: [libnbd PATCH 6/8] states: Add nbd_pread_callback API
...NBD server for the range starting
> at C<offset> and ending at C<offset> + C<count> - 1. NBD
> can only read all or nothing using this call. The call
> returns when the data has been read fully into C<buf> or there is an
> -error.
> +error. See also C<nbd_pread_callback>, if finer visibility is
> +required into the server's replies.
> +
> +The C<flags> parameter must be C<0> for now (it exists for future NBD
> +protocol extensions).";
> + };
> +
> + "pread_callback", {
> + default_call with
> + a...
2019 May 28
1
Re: [libnbd PATCH 4/4] api: Add DF flag support for pread
...aving some sort of callback that gets invoked
> on each chunk would allow the client to add in such checking; we could
> even provide a utility function in the library to serve as such a
> callback if our checking is sufficient for the client's purposes.
> Something like:
>
> nbd_pread_callback(nbd, buf, count, offset, opaque, callback, flags)
>
> where we still read off the wire into buf (to avoid ping-ponging a read
> into a temporary buf that the callback then has to memcpy() into the
> real buf), but call the callback as soon as each chunk is received:
>
> callback...
2019 May 28
2
Re: [libnbd PATCH 4/4] api: Add DF flag support for pread
On Mon, May 27, 2019 at 09:01:01PM -0500, Eric Blake wrote:
> diff --git a/lib/rw.c b/lib/rw.c
> index feaf468..343c340 100644
> --- a/lib/rw.c
> +++ b/lib/rw.c
> @@ -234,11 +234,17 @@ int64_t
> nbd_unlocked_aio_pread (struct nbd_handle *h, void *buf,
> size_t count, uint64_t offset, uint32_t flags)
> {
> - if (flags != 0) {
> + if ((flags
2019 May 28
0
Re: [libnbd PATCH 4/4] api: Add DF flag support for pread
...ent
overlapping chunks). But having some sort of callback that gets invoked
on each chunk would allow the client to add in such checking; we could
even provide a utility function in the library to serve as such a
callback if our checking is sufficient for the client's purposes.
Something like:
nbd_pread_callback(nbd, buf, count, offset, opaque, callback, flags)
where we still read off the wire into buf (to avoid ping-ponging a read
into a temporary buf that the callback then has to memcpy() into the
real buf), but call the callback as soon as each chunk is received:
callback(opaque, buf, count, offset, s...
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
...fs/2019-May/msg00209.html
Eric Blake (8):
states: Add state for structured reply completion
states: Consolidate search for current reply's command
pread: Reject server SR read response with no data chunks
states: Prepare for read callback
states: Wire in a read callback
states: Add nbd_pread_callback API
states: Add tests for nbd_pread_callback
states: Add DF flag support for pread
.gitignore | 1 +
generator/generator | 140 +++++++++++++++++++--
generator/states-reply-simple.c | 31 +++--
generator/states-reply-structured.c | 147 +++++++++...
2019 Jun 20
1
Re: [libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
On Mon, Jun 17, 2019 at 08:39:43PM -0500, Eric Blake wrote:
> Exploration of what it would take to treat the nbd_pread_callback
> status parameter as a language-appropriate enum rather than a bare
> integer. While I've identified a rough set of the places to change, I
> have not actually got it working with Python or OCaml bindings.
> ---
>
> Posting this more for an idea of whether we want to pursue...
2019 Jul 24
2
Re: [PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...| 32 +-
> 7 files changed, 364 insertions(+), 446 deletions(-)
>
> diff --git a/docs/libnbd.pod b/docs/libnbd.pod
> index 5608e63..631bb3b 100644
> --- a/docs/libnbd.pod
> +++ b/docs/libnbd.pod
> @@ -487,8 +487,7 @@ 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
Should we tweak this to explicitly call out "Callbacks in the C
language", to differentiate it from bindings to other languages that do
n...
2019 Jul 24
0
Re: [PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...> 7 files changed, 364 insertions(+), 446 deletions(-)
> >
> > diff --git a/docs/libnbd.pod b/docs/libnbd.pod
> > index 5608e63..631bb3b 100644
> > --- a/docs/libnbd.pod
> > +++ b/docs/libnbd.pod
> > @@ -487,8 +487,7 @@ 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
>
> Should we tweak this to explicitly call out "Callbacks in the C
> language", to differentiate it from binding...
2019 Aug 13
1
Re: [PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...ents (eg. C<nbd_aio_pread> for
equivalent
> +starting a command).
>
> =head2 glib2 integration
>
> @@ -600,8 +599,8 @@ will use your login name):
> =head1 CALLBACKS
>
> Some libnbd calls take function pointers (eg.
> -C<nbd_set_debug_callback>, C<nbd_pread_callback>). Libnbd can call
Eww - we had a bogus link (that should have been
nbd_aio_pread_callback). Nice that we fix that as a side effect.
> -these functions while processing.
> +C<nbd_set_debug_callback>, C<nbd_aio_pread>). Libnbd can call these
> +functions while processing....
2019 Jun 18
0
[libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
Exploration of what it would take to treat the nbd_pread_callback
status parameter as a language-appropriate enum rather than a bare
integer. While I've identified a rough set of the places to change, I
have not actually got it working with Python or OCaml bindings.
---
Posting this more for an idea of whether we want to pursue it
further. I have no hard fe...
2019 Aug 13
2
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
This applies on top of the OClosure v2 series posted a few
minutes ago.
Rich.
2019 Jul 24
2
Re: [PATCH libnbd 2/3] lib: Implement closure lifetimes.
..._CALLBACK_VALID|LIBNBD_CALLBACK_FREE, meaning it's the
> last valid call.)
>
>
> diff --git a/docs/libnbd.pod b/docs/libnbd.pod
> index 631bb3b..e9a6030 100644
> --- a/docs/libnbd.pod
> +++ b/docs/libnbd.pod
> @@ -487,7 +487,59 @@ 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 first parameter to the callback.
> +as the second parameter to the callback.
> +
> +=head2 Callback lifetimes
> +
> +All...
2019 Jul 24
6
[PATCH libnbd 0/3] Implement closure lifetimes.
This implements most of what I wrote here:
https://www.redhat.com/archives/libguestfs/2019-July/msg00213.html
2019 Jul 24
8
[PATCH libnbd v2 0/5] lib: Implement closure lifetimes.
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-July/thread.html#00231
The changes address everything that Eric picked up in his review of
the first two patches. I have also added two more patches (4 and 5)
which respectively fix docs and change int status -> unsigned status,
as discussed.
Passes make, check, check-valgrind.
Rich.
2019 Jul 24
0
[PATCH libnbd 2/3] lib: Implement closure lifetimes.
...c | 11 +-
tests/oldstyle.c | 10 +-
15 files changed, 233 insertions(+), 168 deletions(-)
diff --git a/docs/libnbd.pod b/docs/libnbd.pod
index 631bb3b..e9a6030 100644
--- a/docs/libnbd.pod
+++ b/docs/libnbd.pod
@@ -487,7 +487,59 @@ 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 first parameter to the callback.
+as the second parameter to the callback.
+
+=head2 Callback lifetimes
+
+All callbacks have an C<int valid_flag> pa...
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...command is complete).
+is a low level asynchronous equivalents (eg. C<nbd_aio_pread> for
+starting a command).
=head2 glib2 integration
@@ -600,8 +599,8 @@ will use your login name):
=head1 CALLBACKS
Some libnbd calls take function pointers (eg.
-C<nbd_set_debug_callback>, C<nbd_pread_callback>). Libnbd can call
-these functions while processing.
+C<nbd_set_debug_callback>, C<nbd_aio_pread>). 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. The opaqu...
2019 Jul 24
0
[PATCH libnbd v2 2/5] lib: Implement closure lifetimes.
...c | 13 +-
tests/oldstyle.c | 10 +-
15 files changed, 298 insertions(+), 236 deletions(-)
diff --git a/docs/libnbd.pod b/docs/libnbd.pod
index 631bb3b..0ce4d32 100644
--- a/docs/libnbd.pod
+++ b/docs/libnbd.pod
@@ -487,7 +487,59 @@ 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 first parameter to the callback.
+as the second parameter to the callback.
+
+=head2 Callback lifetimes
+
+All callbacks have an C<unsigned valid_flag&g...
2019 Jul 24
0
[PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...| 3 +-
lib/rw.c | 32 +-
7 files changed, 364 insertions(+), 446 deletions(-)
diff --git a/docs/libnbd.pod b/docs/libnbd.pod
index 5608e63..631bb3b 100644
--- a/docs/libnbd.pod
+++ b/docs/libnbd.pod
@@ -487,8 +487,7 @@ 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 first parameter to the callback. libnbd functions that take
-two callback pointers share the same opaque data for both calls.
+as the first parameter to t...
2019 Jul 25
0
[PATCH libnbd v3 1/2] lib: Implement closure lifetimes.
...g
/tests/can-zero-flag
+/tests/closure-lifetimes
/tests/connect-tcp
/tests/connect-tls-certs
/tests/connect-tls-psk
diff --git a/docs/libnbd.pod b/docs/libnbd.pod
index 4d31c64..1924305 100644
--- a/docs/libnbd.pod
+++ b/docs/libnbd.pod
@@ -487,7 +487,64 @@ 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 first 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 c...