search for: cmd_flag_req_one

Displaying 18 results from an estimated 18 matches for "cmd_flag_req_one".

2020 Jul 09
0
[nbdkit PATCH] blocksize: Fix .extents when plugin changes type within minblock
...flags)) + offs = offs + length + +# Test a loop over the entire device +while offs < size: + h.block_status (size - offs, offs, f) +assert entries == [(4096, 0), (4096, 3), (57344, 0)] + +# Unaligned status queries must also work +offs = 1 +entries = [] +h.block_status (1, offs, f, nbd.CMD_FLAG_REQ_ONE) +assert entries == [(1, 0)] + +offs = 512 +entries = [] +h.block_status (512, offs, f) +assert entries == [(3584, 0)] + +offs = 4095 +entries=[] +while offs < 4097: + h.block_status (4097 - offs, offs, f, nbd.CMD_FLAG_REQ_ONE) +assert entries == [(1, 0), (1, 3)] +' + +# Now run everythin...
2019 May 28
0
[libnbd PATCH 4/4] api: Add DF flag support for pread
...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_set_size_and_flags (struct nbd_handle *h, return -1; } + if (eflags & NBD_FLAG_SEND_DF && !h->structured_replies)...
2019 May 28
0
[libnbd PATCH 2/4] api: Rearrange flags argument to block_status
...if (nbd_block_status (nbd, exportsize, 0, 0, NULL, cb) == -1) { + if (nbd_block_status (nbd, exportsize, 0, NULL, cb, 0) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } assert (calls == 0x11); - if (nbd_block_status (nbd, exportsize, 0, LIBNBD_CMD_FLAG_REQ_ONE, - &exportsize, cb) == -1) { + if (nbd_block_status (nbd, exportsize, 0, &exportsize, cb, + LIBNBD_CMD_FLAG_REQ_ONE) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } diff --git a/lib/rw.c b/lib/...
2019 Jun 18
0
[libnbd PATCH 5/8] states: Wire in a read callback
...ns(+), 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; ] (*----------------------------------------------------------------------*) diff --git a/generator/states-reply-simple.c b/generator/states-reply-simple.c in...
2019 Jun 21
0
[libnbd PATCH v2 2/5] states: Wire in a read callback
...ns(+), 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; ] (*----------------------------------------------------------------------*) diff --git a/generator/states-reply-simple.c b/generator/states-reply-simple.c in...
2019 Aug 10
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...onstants, 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 @@ let rec print_arg_list ?(handle = false) ?(types = true) args optargs = if !comma then pr ", "; comma := true;...
2019 Jun 18
0
[libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...ing (* struct sockaddr * + socklen_t *) | String of string (* string *) | StringList of string (* argv-style NULL-terminated array of strings *) @@ -2033,10 +2034,13 @@ let constants = [ "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; +] +let enums = [ + "nbd_read_status", [ + "READ_DATA", 1; + "READ_HOLE", 2; + "READ_ERROR"...
2019 Jun 21
0
[libnbd PATCH v2 5/5] states: Add DF flag support for pread
...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 --- a/interop/structured-read.c +++ b/interop/structured-read.c @@ -38,7 +38,7 @@ static const char *unixsocket; static char rbuf[1024]; str...
2020 Feb 10
1
[nbdkit PATCH] split: Add support for .extents
...TEXT_BASE_ALLOCATION + entries = e +h.block_status (2 * 1024 * 1024, 0, f) +assert entries == [ 512 * 1024, 3, + 1024 * 1024, 0, + 512 * 1024, 3 ] +entries = [] +# With req one, extents stop at file boundaries +h.block_status (1024 * 1024, 768 * 1024, f, nbd.CMD_FLAG_REQ_ONE) +assert entries == [ 256 * 1024, 0 ] + "' -- 2.24.1
2019 Jun 20
1
Re: [libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...klen_t *) > | String of string (* string *) > | StringList of string (* argv-style NULL-terminated array of strings *) > @@ -2033,10 +2034,13 @@ let constants = [ > "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; > +] > +let enums = [ > + "nbd_read_status", [ > + "READ_DATA", 1; > + "READ_HOLE&qu...
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 Jun 21
9
[libnbd PATCH v2 0/5] nbd_pread_structured
Since v1: - rebase to applied patches - split out support for Int in callbacks - sort of test that callbacks work in OCaml (see comment in patch 5) - rename API to nbd_pread_structured - expose error as explicit parameter to callback Eric Blake (5): generator: Allow Int in callbacks states: Wire in a read callback states: Add nbd_pread_structured API states: Add tests for
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...16384, 2, 16384, 0] -h.block_status (1024, 32256, 42, f) +h.block_status (1024, 32256, lambda *args: f (42, *args)) print ("entries = %r" % entries) assert entries == [ 512, 3, 16384, 2] -h.block_status (1024, 32256, 42, f, nbd.CMD_FLAG_REQ_ONE) +h.block_status (1024, 32256, lambda *args: f (42, *args), + nbd.CMD_FLAG_REQ_ONE) print ("entries = %r" % entries) assert entries == [ 512, 3] diff --git a/python/t/600-debug-callback.py b/python/t/600-debug-callback.py index 40cbd8f..cc03346 100644 --- a/python/t/600-...
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
I've mentioned this topic before (in fact, the idea of adding NBD_CMD_FLAG_DF was first mentioned at [1]), but finally finished enough of an implementation to feel confident in posting it. I'd still like to add something under examples/ that uses the new API to implement strict checking of a server's structured replies read implementation (ensure that a server never sends data after
2019 Jul 16
2
[PATCH libnbd v2] generator: Define new Closure type
As before, but this one has working Python bindings. OCaml still TBD. Rich.
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
2020 Mar 24
1
[PATCH libnbd v3] Add Go language bindings (golang) (RHBZ#1814538).
This feature is roughly finished now, although it needs a few more tests and some examples. It's pretty much up to par with all the other bindings, but it lacks a completely safe AIO buffer. It won't stop you from freeing the buffer too early) because golang's GC inexplicably lacks a way to declare a root from C. I can probably do it with a global variable and ref counting on the
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.