search for: cmd_flag_df

Displaying 15 results from an estimated 15 matches for "cmd_flag_df".

2019 Aug 10
1
Re: [PATCH libnbd 2/9] generator: Generalize OFlags.
...in addition) to restrictions in lib/rw.c can be a later patch. > +++ b/ocaml/tests/test_405_pread_structured.ml > @@ -54,11 +54,13 @@ let () = > NBD.pread_structured nbd buf 0_L (f 42); > assert (buf = expected); > > - NBD.pread_structured nbd buf 0_L (f 42) ~flags:[NBD.cmd_flag_df]; > + let flags = let open NBD.CMD_FLAG in [DF] in > + > + NBD.pread_structured nbd buf 0_L (f 42) ~flags; blank line here... > +++ b/ocaml/tests/test_410_pwrite.ml > @@ -33,7 +33,8 @@ let () = > let nbd = NBD.create () in > NBD.connect_command nbd ["nbdkit&quot...
2019 Jun 21
0
[libnbd PATCH v2 5/5] states: Add DF flag support for pread
...nothing using this call. The call returns when the data has been read fully into C<buf> or there is an error. See also C<nbd_pread_structured>, if finer visibility is -required into the server's replies. +required into the server's replies, or if you want to use +C<LIBNBD_CMD_FLAG_DF>. The C<flags> parameter must be C<0> for now (it exists for future NBD protocol extensions)."; @@ -1379,8 +1391,11 @@ the server obeyed the requirement that a read call must not have overlapping chunks and must not succeed without enough chunks to cover the entire request....
2019 Jun 25
1
[libnbd PATCH] pread_structured: Change callback type to use Mutable error
...print(e) in 405-pread-structured.py is sufficient to produce output resembling: nbd_pread_structured: read: command failed: Protocol error Traceback (most recent call last): File "./t/405-pread-structured.py", line 48, in <module> buf = h.pread_structured (512, 0, 43, f, nbd.CMD_FLAG_DF) File "/home/eblake/libnbd/python/nbd.py", line 517, in pread_structured return libnbdmod.pread_structured (self._o, count, offset, data, chunk, flag s) RuntimeError: nbd_pread_structured: read: command failed: Protocol error where assigning to error.value in the callback affected...
2019 Aug 10
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...;; ] -(* 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 @@ let rec print_arg_list ?(handle = false) ?(types = true) args optargs = if !comma...
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
[libnbd PATCH 4/4] api: Add DF flag support for pread
.... The call returns when the data has been read fully into C<buf> or there is an error. -The C<flags> parameter must be C<0> for now (it exists for future NBD -protocol extensions)."; +The C<flags> parameter may be C<0> for no flags, or may contain +C<LIBNBD_CMD_FLAG_DF> meaning that the server should not fragment +a read reply across more than one 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>).";...
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...allback_fn callback, uint32_t flags) { - struct command_cb cb = { .opaque = opaque, .fn.read = read, + struct command_cb cb = { .user_data = user_data, .fn.read = read, .callback = callback, }; if ((flags & ~LIBNBD_CMD_FLAG_DF) != 0) { @@ -320,10 +323,10 @@ nbd_unlocked_aio_pwrite (struct nbd_handle *h, const void *buf, int64_t nbd_unlocked_aio_pwrite_callback (struct nbd_handle *h, const void *buf, size_t count, uint64_t offset, - void *opaque, callba...
2019 Jun 18
0
[libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...k status *) | SockAddrAndLen of string * string (* 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_HO...
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 Jun 20
1
Re: [libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...dLen of string * string (* 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", [ > + "REA...
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
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 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...
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.