search for: cmd_flag_fua

Displaying 20 results from an estimated 24 matches for "cmd_flag_fua".

2019 May 28
1
Re: [PATCH] api: Add a special type for the flags argument.
...> --- a/python/t/410-pwrite.py > +++ b/python/t/410-pwrite.py > @@ -33,7 +33,7 @@ h = nbd.NBD () > h.connect_command (["nbdkit", "-s", "--exit-with-parent", "-v", > "file", datafile]) > h.pwrite (buf1, 0, nbd.CMD_FLAG_FUA) There's still the question of how to pass two flags at once; if I understand your patch (and after confirming it with nbdsh), we have to write: h.zero (64*1024, 0, nbd.CMD_FLAG_FUA | nbd.CMD_FLAG_NO_HOLE) [side note - requires a server that supports flush; to my surprise, nbkdit 'null...
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 Aug 10
1
Re: [PATCH libnbd 2/9] generator: Generalize OFlags.
...pwrite.ml > @@ -33,7 +33,8 @@ let () = > let nbd = NBD.create () in > NBD.connect_command nbd ["nbdkit"; "-s"; "--exit-with-parent"; "-v"; > "file"; datafile]; > - NBD.pwrite nbd buf1 0_L ~flags:[NBD.cmd_flag_fua]; > + let flags = let open NBD.CMD_FLAG in [FUA] in > + NBD.pwrite nbd buf1 0_L ~flags; ...but not here. It doesn't affect the code, but the consistency may be worth it. This and patch 1 look fine to me. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3...
2019 Oct 03
0
[nbdkit PATCH 2/4] tests: Test retry with different fua/fast-zero flags
...try-zero-flags-count retry-zero-flags-open-count +start_t=$SECONDS + +# Create a custom plugin which will test retrying. +nbdkit -v -U - \ + sh - \ + --filter=retry retry-delay=1 \ + --run 'nbdsh --uri $uri -c " +h.zero (512, 0) +try: + h.zero (512, 0, + nbd.CMD_FLAG_FUA | nbd.CMD_FLAG_NO_HOLE | nbd.CMD_FLAG_FAST_ZERO) +except nbd.Error as ex: + assert ex.errno == \"ENOTSUP\" +h.zero (512, 0, nbd.CMD_FLAG_FUA) + "' <<'EOF' +#!/usr/bin/env bash +case "$1" in + open) + # Count how many times the connection...
2019 Nov 22
0
[PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...s. + +# Test pread. +h = test ({"size": 512}) +buf = h.pread (512, 0) + +# Test pwrite + flags. +h = test ({"size": 512}) +h.pwrite (buf, 0) + +h = test ({"size": 512, "can_fua": "native", "pwrite_expect_fua": True}) +h.pwrite (buf, 0, nbd.CMD_FLAG_FUA) + +# Test flush. +h = test ({"size": 512, "can_flush": True}) +h.flush () + +# Test trim + flags. +h = test ({"size": 512, "can_trim": True}) +h.trim (512, 0) + +h = test ({"size": 512, + "can_trim": True, "can_fua": &...
2019 Nov 22
3
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...ze": 512}) > +buf = h.pread (512, 0) > + > +# Test pwrite + flags. > +h = test ({"size": 512}) > +h.pwrite (buf, 0) > + > +h = test ({"size": 512, "can_fua": "native", "pwrite_expect_fua": True}) > +h.pwrite (buf, 0, nbd.CMD_FLAG_FUA) > + > +# Test flush. > +h = test ({"size": 512, "can_flush": True}) > +h.flush () > + > +# Test trim + flags. > +h = test ({"size": 512, "can_trim": True}) > +h.trim (512, 0) > + > +h = test ({"size": 512, > +...
2019 Aug 10
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...h callback on completion"; @@ -2369,17 +2385,12 @@ C<nbd_aio_connect_uri>."; ] -(* Constants, flags, etc. *) +(* Constants, etc. *) let constants = [ "AIO_DIRECTION_READ", 1; "AIO_DIRECTION_WRITE", 2; "AIO_DIRECTION_BOTH", 3; - "CMD_FLAG_FUA", 1 lsl 0; - "CMD_FLAG_NO_HOLE", 1 lsl 1; - "CMD_FLAG_DF", 1 lsl 2; - "CMD_FLAG_REQ_ONE", 1 lsl 3; - "READ_DATA", 1; "READ_HOLE", 2; "READ_ERROR", 3; @@ -3373,7 +3384,7 @@...
2019 May 28
0
[libnbd PATCH 4/4] api: Add DF flag support for pread
...ne packet, even if using multiple +packets would otherwise allow a more efficient representation of +holes contained in the region (if that is supported - some servers +cannot do this, see C<nbd_can_df>)."; }; "pwrite", { @@ -1774,6 +1790,7 @@ let constants = [ "CMD_FLAG_FUA", 1 lsl 0; "CMD_FLAG_NO_HOLE", 1 lsl 1; + "CMD_FLAG_DF", 1 lsl 2; "CMD_FLAG_REQ_ONE", 1 lsl 3; ] diff --git a/lib/flags.c b/lib/flags.c index 421a7d2..cdbc28f 100644 --- a/lib/flags.c +++ b/lib/flags.c @@ -42,6 +42,11 @@ nbd_internal_...
2019 Jun 18
0
[libnbd PATCH 5/8] states: Wire in a read callback
...++++++++++++-- lib/internal.h | 4 ++- 4 files changed, 62 insertions(+), 4 deletions(-) diff --git a/generator/generator b/generator/generator index 4c81859..2614689 100755 --- a/generator/generator +++ b/generator/generator @@ -1934,6 +1934,10 @@ let constants = [ "CMD_FLAG_FUA", 1 lsl 0; "CMD_FLAG_NO_HOLE", 1 lsl 1; "CMD_FLAG_REQ_ONE", 1 lsl 3; + + "READ_DATA", 1; + "READ_HOLE", 2; + "READ_ERROR", 3; ] (*------------------------------------------------------------...
2019 Jun 21
0
[libnbd PATCH v2 2/5] states: Wire in a read callback
...++++++++++++-- lib/internal.h | 4 ++- 4 files changed, 63 insertions(+), 4 deletions(-) diff --git a/generator/generator b/generator/generator index 2d1a4e5..b408509 100755 --- a/generator/generator +++ b/generator/generator @@ -1934,6 +1934,10 @@ let constants = [ "CMD_FLAG_FUA", 1 lsl 0; "CMD_FLAG_NO_HOLE", 1 lsl 1; "CMD_FLAG_REQ_ONE", 1 lsl 3; + + "READ_DATA", 1; + "READ_HOLE", 2; + "READ_ERROR", 3; ] (*------------------------------------------------------------...
2019 Nov 22
18
[PATCH nbdkit v2 00/10] Implement nbdkit API v2 for Python plugins.
v1: https://www.redhat.com/archives/libguestfs/2019-November/msg00153.html v2: - Fix implementation of can_cache. - Add implementation of can_fua. - Add a very thorough test suite which tests every command + flag combination.
2019 Oct 03
7
[nbdkit PATCH 0/4] More work with retry safety
I'm still working on another set of patches to have reopen call .finalize/.prepare (so that another filter can safely appear between retry and the plugin), but for tonight, these are the patches I think are ready to go. Eric Blake (4): retry: Handle can_fua and can_fast_zero changes tests: Test retry with different fua/fast-zero flags server: Close backends if a filter's .open fails
2019 Jun 21
0
[libnbd PATCH v2 5/5] states: Add DF flag support for pread
...g that the server should not reply with +more than one fragment (if that is supported - some servers cannot do +this, see C<nbd_can_df>). Libnbd does not validate that the server +actually obeys the flag."; }; "pwrite", { @@ -2025,6 +2040,7 @@ let constants = [ "CMD_FLAG_FUA", 1 lsl 0; "CMD_FLAG_NO_HOLE", 1 lsl 1; + "CMD_FLAG_DF", 1 lsl 2; "CMD_FLAG_REQ_ONE", 1 lsl 3; "READ_DATA", 1; diff --git a/interop/structured-read.c b/interop/structured-read.c index ea47254..cf8b893 100644 ---...
2019 Nov 25
7
[PATCH nbdkit v2 0/7] Implement nbdkit API v2 for Python plugins.
v3 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00209.html In v4: - Rebase on top of current master. Includes various fixes and updates required because of Nir's patches that went into master. - Fix api_version() -> API_VERSION in patch 2 noted previously on the mailing list. Rich.
2019 Aug 10
0
[PATCH libnbd 1/5] python: Change aio_buffer into nbd.Buffer class.
...,17 @@ h = nbd.NBD () h.connect_command (["nbdkit", "-s", "--exit-with-parent", "-v", "file", datafile]) -buf1 = nbd.aio_buffer_from_bytearray (buf) +buf1 = nbd.Buffer.from_bytearray (buf) cookie = h.aio_pwrite (buf1, 0, nbd.CMD_FLAG_FUA) while not (h.aio_command_completed (cookie)): h.poll (-1) -buf2 = nbd.aio_buffer (512) +buf2 = nbd.Buffer (512) cookie = h.aio_pread (buf2, 0) while not (h.aio_command_completed (cookie)): h.poll (-1) -assert buf == nbd.aio_buffer_to_bytearray (buf2) +assert buf == buf2.to_bytearr...
2019 Nov 23
8
[PATCH nbdkit v3 0/7] Implement nbdkit API v2 for Python plugins.
v2 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00163.html I pushed patch 1 (with spelling fix), patch 4 and patch 5 since those were previously ACKed on the list. Differences in v3: - Add error checking to PyModule_AddIntConstant. - Use API_VERSION constant instead of function. - Add max API version supported to --dump-plugin output. - Print API_VERSION selected by
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 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 28
0
[PATCH] api: Add a special type for the flags argument.
...index 9152ba2..811f233 100644 --- a/python/t/410-pwrite.py +++ b/python/t/410-pwrite.py @@ -33,7 +33,7 @@ h = nbd.NBD () h.connect_command (["nbdkit", "-s", "--exit-with-parent", "-v", "file", datafile]) h.pwrite (buf1, 0, nbd.CMD_FLAG_FUA) -buf2 = h.pread (512, 0, 0) +buf2 = h.pread (512, 0) assert buf1 == buf2 diff --git a/python/t/460-block-status.py b/python/t/460-block-status.py index f511091..eeaa7b2 100644 --- a/python/t/460-block-status.py +++ b/python/t/460-block-status.py @@ -34,14 +34,14 @@ def f (data, metacontext, o...
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