Displaying 9 results from an estimated 9 matches for "max_reads_in_flight".
2019 Aug 13
1
Re: [PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...ay matter more for functions that don't take
a buf (such as nbd_aio_trim).
> +++ b/lib/rw.c
Yep, definitely a mechanical conversion.
> +++ b/ocaml/examples/asynch_copy.ml
> @@ -48,7 +48,7 @@ let asynch_copy src dst =
> if !soff < size && NBD.aio_in_flight src < max_reads_in_flight then (
> let bs = min bs (size -^ !soff) in
> let buf = NBD.Buffer.alloc (Int64.to_int bs) in
> - ignore (NBD.aio_pread_callback src buf !soff
> + ignore (NBD.aio_pread src buf !soff
> ~completion:(read_completed buf !soff));
Pre-existing; bu...
2019 Aug 14
0
[PATCH libnbd 3/3] python: Add test for doing asynch copy from one handle to another.
...details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+import select
+import nbd
+
+disk_size = 512 * 1024 * 1024
+bs = 65536
+max_reads_in_flight = 16
+bytes_read = 0
+bytes_written = 0
+
+def asynch_copy (src, dst):
+ size = src.get_size ()
+
+ # This is our reading position in the source.
+ soff = 0
+
+ # This callback is called when any pread from the source
+ # has completed.
+ writes = []
+ def read_completed (buf,...
2019 Aug 11
4
[PATCH libnbd v2 0/3] python: Add test for doing asynch copy.
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-August/msg00103.html
In v2 I've made several changes:
- Fix Python callbacks so if they don't return something
which is int-like, we assume they mean to return 0.
- Add nbd.Buffer free() method. Read commit message in
patch 2 to see what this is about.
- Fixed the asynch copy test to deal with the unbelievably
2019 Aug 14
5
[PATCH libnbd 0/3] Use free callback to hold ref to AIO buffer.
Basically the same as this patch series, but for Python:
https://www.redhat.com/archives/libguestfs/2019-August/msg00235.html
plus adding the 590 asynch test at the end.
Rich.
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 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 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...xtent_user_data,
diff --git a/ocaml/examples/asynch_copy.ml b/ocaml/examples/asynch_copy.ml
index 5aa6e60..8057118 100644
--- a/ocaml/examples/asynch_copy.ml
+++ b/ocaml/examples/asynch_copy.ml
@@ -48,7 +48,7 @@ let asynch_copy src dst =
if !soff < size && NBD.aio_in_flight src < max_reads_in_flight then (
let bs = min bs (size -^ !soff) in
let buf = NBD.Buffer.alloc (Int64.to_int bs) in
- ignore (NBD.aio_pread_callback src buf !soff
+ ignore (NBD.aio_pread src buf !soff
~completion:(read_completed buf !soff));
soff := !soff +^ bs
);
@@ -59,...
2019 Aug 15
13
[PATCH libnbd v2 00/10] Callbacks and OCaml and Python persistent buffers.
This is a combination of these two earlier series:
https://www.redhat.com/archives/libguestfs/2019-August/msg00235.html
https://www.redhat.com/archives/libguestfs/2019-August/msg00240.html
plus changes to allow .callback = NULL / .free != NULL, and to reduce
the complexity of freeing callbacks.
Although it's rather long there's nothing complex here. We might
consider squashing some
2020 Mar 25
3
[PATCH libnbd v4] Add Go language bindings (golang) (RHBZ#1814538).
Now runs a complete set of tests, notably including the AIO test.
File descriptors are passed in and out as plain ints (instead of
*os.File) for a couple of reasons: (1) We have to pass the plain int
to syscall.Select. (2) Turning an fd into an os.File causes golang to
set the blocking flag which is deeply unhelpful.
Rich.