Displaying 6 results from an estimated 6 matches for "to_bytearray".
2019 Aug 10
0
[PATCH libnbd 1/5] python: Change aio_buffer into nbd.Buffer class.
...@ -3981,8 +3981,10 @@ raise_exception ()
pr "extern PyObject *nbd_internal_py_%s (PyObject *self, PyObject *args);\n"
name;
) ([ "create"; "close";
- "alloc_aio_buffer"; "aio_buffer_from_bytearray";
- "aio_buffer_to_bytearray" ] @ List.map fst handle_calls);
+ "alloc_aio_buffer";
+ "aio_buffer_from_bytearray";
+ "aio_buffer_to_bytearray";
+ "aio_buffer_size" ] @ List.map fst handle_calls);
pr "\n";
pr "#endif /* LIBNBD_METHODS_H...
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 26
2
Re: [PATCH disk-sync 5/5] Convert disk_sync inner loop to asynchronous.
...09,26 @@ def get_block_status(nbd_handle, extent):
> return blocks
>
>
>+# This is called back when nbd_aio_pread completes.
>+def read_completed(fd, buf, offset, err):
>+ logging.debug('Writing %d B to offset %d B' % (buf.size(), offset))
>+ os.pwrite(fd, buf.to_bytearray(), offset)
>+ # By returning 1 here we auto-retire the aio_pread command.
>+ return 1
>+
>+
>+# Process any AIO requests without blocking.
>+def process_aio_requests(nbd_handle):
>+ while nbd_handle.poll(0) == 1:
>+ pass
>+
>+
>+# Block until all AIO...
2019 Aug 22
0
[PATCH disk-sync 5/5] Convert disk_sync inner loop to asynchronous.
.../disk_sync.py
@@ -409,6 +409,26 @@ def get_block_status(nbd_handle, extent):
return blocks
+# This is called back when nbd_aio_pread completes.
+def read_completed(fd, buf, offset, err):
+ logging.debug('Writing %d B to offset %d B' % (buf.size(), offset))
+ os.pwrite(fd, buf.to_bytearray(), offset)
+ # By returning 1 here we auto-retire the aio_pread command.
+ return 1
+
+
+# Process any AIO requests without blocking.
+def process_aio_requests(nbd_handle):
+ while nbd_handle.poll(0) == 1:
+ pass
+
+
+# Block until all AIO commands on the handle have finished.
+def...
2019 Aug 22
7
[PATCH disk-sync 0/5] Misc cleanups and convert inner loop to asynch.
This is based on top of:
https://github.com/nertpinx/v2v-conversion-host/commit/0bb2efdcacd975a2cae7380080991ac7fc238d2b
The first 4 patches are fairly uncontroversial miscellaneous cleanups.
Patch 5 is the interesting one. (Note it doesn't quite work yet, so
it's for discussion only.)
Patch 5 converts the inner loop to use asynchronous libnbd calls.
performance improves quite a bit for
2019 Aug 27
0
Re: [PATCH disk-sync 5/5] Convert disk_sync inner loop to asynchronous.
...handle, extent):
> > return blocks
> >
> >
> >+# This is called back when nbd_aio_pread completes.
> >+def read_completed(fd, buf, offset, err):
> >+ logging.debug('Writing %d B to offset %d B' % (buf.size(), offset))
> >+ os.pwrite(fd, buf.to_bytearray(), offset)
> >+ # By returning 1 here we auto-retire the aio_pread command.
> >+ return 1
> >+
> >+
> >+# Process any AIO requests without blocking.
> >+def process_aio_requests(nbd_handle):
> >+ while nbd_handle.poll(0) == 1:
> >+ pas...