search for: aio_command_completed

Displaying 20 results from an estimated 21 matches for "aio_command_completed".

2019 Aug 14
4
[libnbd PATCH 0/2] Fix test 505
Rich found that I had been using bogus logic, but it was hidden by other bugs in our language bindings until recently. Eric Blake (2): python: Fix test 505 ocaml: Fix test 505 python/t/505-aio-pread-callback.py | 14 +++++++------- .../test_505_aio_pread_structured_callback.ml | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) -- 2.20.1
2019 Aug 14
0
[libnbd PATCH 2/2] ocaml: Fix test 505
...et () = @@ -61,7 +61,7 @@ let () = (* First try: succeed in both callbacks *) let buf = NBD.Buffer.alloc 512 in let cookie = NBD.aio_pread_structured nbd buf 0_L (chunk 42) - ~completion:(callback 42) in + ~completion:(callback (42, 42)) in while not (NBD.aio_command_completed nbd cookie) do ignore (NBD.poll nbd (-1)) done; @@ -73,7 +73,7 @@ let () = (* Second try: fail only during callback *) let buf = NBD.Buffer.alloc 512 in let cookie = NBD.aio_pread_structured nbd buf 0_L (chunk 42) - ~completion:(callback 43) in + ~co...
2019 Aug 13
0
[PATCH libnbd 6/6] lib: Make all completion callbacks into OClosures.
...try: succeed in both callbacks *) let buf = NBD.Buffer.alloc 512 in - let cookie = NBD.aio_pread_structured_callback nbd buf 0_L (chunk 42) (callback 42) in + let cookie = NBD.aio_pread_structured_callback nbd buf 0_L (chunk 42) + ~completion:(callback 42) in while not (NBD.aio_command_completed nbd cookie) do ignore (NBD.poll nbd (-1)) done; @@ -71,7 +72,8 @@ let () = (* Second try: fail only during callback *) let buf = NBD.Buffer.alloc 512 in - let cookie = NBD.aio_pread_structured_callback nbd buf 0_L (chunk 42) (callback 43) in + let cookie = NBD.aio_pread_structured...
2019 Aug 13
0
[PATCH libnbd v2 2/3] lib: Make all completion callbacks into OClosures.
...try: succeed in both callbacks *) let buf = NBD.Buffer.alloc 512 in - let cookie = NBD.aio_pread_structured_callback nbd buf 0_L (chunk 42) (callback 42) in + let cookie = NBD.aio_pread_structured_callback nbd buf 0_L (chunk 42) + ~completion:(callback 42) in while not (NBD.aio_command_completed nbd cookie) do ignore (NBD.poll nbd (-1)) done; @@ -71,7 +72,8 @@ let () = (* Second try: fail only during callback *) let buf = NBD.Buffer.alloc 512 in - let cookie = NBD.aio_pread_structured_callback nbd buf 0_L (chunk 42) (callback 43) in + let cookie = NBD.aio_pread_structured...
2019 Aug 10
0
[PATCH libnbd 1/5] python: Change aio_buffer into nbd.Buffer class.
...12 @@ import nbd h = nbd.NBD () h.connect_command (["nbdkit", "-s", "--exit-with-parent", "-v", "pattern", "size=512"]) -buf = nbd.aio_buffer (512) +buf = nbd.Buffer (512) cookie = h.aio_pread (buf, 0) while not (h.aio_command_completed (cookie)): h.poll (-1) -buf = nbd.aio_buffer_to_bytearray (buf) +buf = buf.to_bytearray () print ("%r" % buf) diff --git a/python/t/505-aio-pread-callback.py b/python/t/505-aio-pread-callback.py index 9246616..e552db8 100644 --- a/python/t/505-aio-pread-callback.py +++ b/pytho...
2019 Aug 10
7
[PATCH libnbd 0/5] WIP: python: Add test for doing asynch copy.
This doesn't yet work. However it does make me more convinced than ever that we really need to sort out persistent buffer lifetimes in the library (similar to what we did for closures). Rich.
2019 Jul 11
1
Re: [libnbd] Slight API inconsistency
On Thu, Jul 11, 2019 at 09:35:02AM -0500, Eric Blake wrote: >On 7/11/19 9:23 AM, Martin Kletzander wrote: >> The callback (e.g. for `nbd_block_status`) now has a support for returning >> errors thanks to the last parameter (`int *error`), so it was switched to >> returning void. > >No, the callback still returns int. Where are you seeing it return >void, because
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...permitted_states = [ Connected ]; - shortdesc = "read from the NBD server"; - longdesc = "\ -Issue a read command to the NBD server. This returns the -unique positive 64 bit cookie for this command, or C<-1> on -error. To check if the command completed, call -C<nbd_aio_command_completed>, or use C<nbd_aio_pread_callback>. -Note that you must ensure C<buf> is valid until the command -has completed. Other parameters behave as documented in -C<nbd_pread>."; - }; - - "aio_pread_callback", { default_call with args = [ BytesPersistOut (&q...
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 May 28
0
[PATCH] api: Add a special type for the flags argument.
...-21,7 +21,7 @@ h = nbd.NBD () h.connect_command (["nbdkit", "-s", "--exit-with-parent", "-v", "pattern", "size=512"]) buf = nbd.aio_buffer (512) -id = h.aio_pread (buf, 0, 0) +id = h.aio_pread (buf, 0) while not (h.aio_command_completed (id)): h.poll (-1) diff --git a/python/t/510-aio-pwrite.py b/python/t/510-aio-pwrite.py index b73464b..4770b83 100644 --- a/python/t/510-aio-pwrite.py +++ b/python/t/510-aio-pwrite.py @@ -39,7 +39,7 @@ while not (h.aio_command_completed (id)): h.poll (-1) buf2 = nbd.aio_buffer (512)...
2019 Aug 13
7
[PATCH libnbd v2 0/3] Implement OClosures.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-August/msg00168.html I pushed uncontroversial patches 1-4 v2: - The implementation of OClosure (new patch 1) in Python is fixed. - Patch 2 (old patch 5) is unchanged. - I added a new API for removing debug callbacks. I think this approach has some advantages over using OClosure. - I didn't yet do any work on changing the
2019 May 28
2
[PATCH] api: Add a special type for the flags argument.
This applies on top of patches 1 & 2 here (instead of patch 3): https://www.redhat.com/archives/libguestfs/2019-May/msg00206.html https://www.redhat.com/archives/libguestfs/2019-May/msg00207.html Rich.
2019 May 28
6
[RFC libnbd PATCH 0/4] Add CMD_FLAG_DF support
RFC because this is an API break, but we haven't declared stable API yet. If we like it, I'm working on using libnbd to implement the nbdkit-nbd plugin; knowing whether it is API version 0.1 or 0.2 will be useful. I also dabbled with allowing optional parameters in python, although my OCaml is weak enough that there may be cleaner ways to approach that. Eric Blake (4): api: Add flags
2019 May 22
0
[libnbd PATCH v3 3/7] commands: Expose FIFO ordering of server completions
...]; ret = RInt64; + shortdesc = "check if any command has completed"; + longdesc = "\ +Return the unique 64 bit handle of the first non-retired but completed +command, or -1 if no command is awaiting retirement. Any handle +returned by this function must still be passed to +C<aio_command_completed> to actually retire the command and learn +whether the command was successful."; + }; + "connection_state", { default_call with args = []; ret = RConstString; diff --git a/generator/states-reply.c b/generator/states-reply.c index 93f6cda..45362d4 100644 --- a/generat...
2019 Sep 05
0
[PATCH libnbd] generator: Move first_version fields to a single table.
...", (1, 0); + "aio_notify_write", (1, 0); + "aio_is_created", (1, 0); + "aio_is_connecting", (1, 0); + "aio_is_ready", (1, 0); + "aio_is_processing", (1, 0); + "aio_is_dead", (1, 0); + "aio_is_closed", (1, 0); + "aio_command_completed", (1, 0); + "aio_peek_command_completed", (1, 0); + "aio_in_flight", (1, 0); + "connection_state", (1, 0); + "get_package_name", (1, 0); + "get_version", (1, 0); + "kill_subprocess", (1, 0); + "supports_tls", (1, 0);...
2019 Sep 05
3
[PATCH libnbd] generator: Move first_version fields to a single table.
This doesn't include Eric's new APIs, but if you push those then I can rebase this one on top. Rich.
2019 Aug 13
12
[PATCH 0/6] Implement OClosure.
Patches 1-4 are basically uncontroversial, straightforward refactoring and IMHO we should just push them. Possibly 1-3 should be squashed together, but I posted them separately so they are easier to review. Patches 5 and 6 together implement OClosure. Patch 5 adds the feature and is simple to understand. Patch 6 changes the Closure completion callbacks into OClosure, but because it doesn't
2019 Aug 10
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...() = "file"; datafile]; let buf1 = NBD.Buffer.of_bytes buf in - let cookie = NBD.aio_pwrite nbd buf1 0_L ~flags:[NBD.cmd_flag_fua] in + let flags = let open NBD.CMD_FLAG in [FUA] in + let cookie = NBD.aio_pwrite nbd buf1 0_L ~flags in while not (NBD.aio_command_completed nbd cookie) do ignore (NBD.poll nbd (-1)) done; -- 2.22.0
2019 May 22
12
[libnbd PATCH v3 0/7] Avoid deadlock with in-flight commands
Since v2: - rebase to Rich's new API calls - more refactoring in patch 1 (retitled) - new patches 3 and 4 - fix data corruption in patch 6 (was 4) - more tweaks to the reproducer example (including using new API from 3) Eric Blake (7): lib: Refactor command_common() to do more common work commands: Allow for a command queue commands: Expose FIFO ordering of server completions
2019 Aug 10
17
[PATCH libnbd 0/9] Add Enum and Flags types.
This largish series adds several new features to the generator. Enum maps to enumerated types (like enum in C). The only current use for this is replacing the nbd_set_tls (nbd, 0/1/2) parameter with LIBNBD_TLS_DISABLE, LIBNBD_TLS_ALLOW, LIBNBD_TLS_REQUIRE (and natural equivalents in other programming languages). Flags maps to any uint32_t bitmask. It is basically a non-optional, generalized