similar to: [libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters

Displaying 20 results from an estimated 1100 matches similar to: "[libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters"

2020 Sep 07
4
[libnbd PATCH v2 0/3] Improve type-safety of ocaml/golang getters
Well, the golang changes (patch 1 and 2/3 of v1) were already committed, all that was left was the OCaml changes. I'm a lot happier with how things turned out with an UNKNOWN constructor in the OCaml variants. Eric Blake (3): tests: Enhance coverage of enum/flag range checking ocaml: Support unknown values for Enum/Flags ocaml: Typesafe returns for REnum/RFlags generator/OCaml.ml
2020 Sep 11
10
[libnbd PATCH v2 0/5] Add knobs for client- vs. server-side validation
In v2: - now based on my proposal to add LIBNBD_SHUTDOWN_IMMEDIATE - four flags instead of two: STRICT_FLAGS is new (patch 4), and STRICT_BOUNDS is separate from STRICT_ZERO_SIZE (patch 5) - various refactorings for more shared code and less duplication Eric Blake (5): api: Add xxx_MASK constant for each Flags type generator: Refactor filtering of accepted OFlags api: Add
2020 Sep 06
0
[libnbd PATCH 2/3] golang: Typesafe returns for REnum/RFlags
Now that we have a distinct branch in the generator when returning an enum or bitmask that cannot fail, we can use it in Golang for symmetry, so that the result of a get function can be plugged into a set function without a trip through other types. --- generator/GoLang.ml | 12 ++++++------ .../libnbd/libnbd_110_defaults_test.go | 6 +++---
2020 Sep 07
2
Re: [libnbd PATCH 1/3] generator: Introduce REnum/RFlags return types
On Sat, Sep 05, 2020 at 08:40:58PM -0500, Eric Blake wrote: > diff --git a/generator/API.mli b/generator/API.mli > index 712e837..e45b5c0 100644 > --- a/generator/API.mli > +++ b/generator/API.mli > @@ -78,6 +78,8 @@ and ret = > | RString (** return a newly allocated string, > caller frees, NULL for error *) > | RUInt
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.
2020 Sep 06
0
[libnbd PATCH 1/3] generator: Introduce REnum/RFlags return types
For now, there is no change to the generated code (although the man pages are slightly improved), but this will make it easier for later patches to improve OCaml and Golang bindings so that set/get pairs are typed symmetrically. --- generator/API.ml | 16 ++++++++++------ generator/API.mli | 2 ++ generator/C.ml | 20 ++++++++++++-------- generator/GoLang.ml | 13 ++++++++++++-
2020 Sep 07
0
[libnbd PATCH v2 3/3] ocaml: Typesafe returns for REnum/RFlags
Now that we have a distinct branch in the generator when returning an enum or bitmask that cannot fail, we can use it in OCaml for symmetry, so that the result of a get function can be plugged into a set function without manual conversion of an integer. This includes the use of the recently-added UNKNOWN catch-all for encoding C values returned by a newer libnbd.so than when the OCaml bindings
2020 Sep 06
0
[libnbd PATCH 3/3] ocaml: Typesafe returns for REnum/RFlags
Now that we have a distinct branch in the generator when returning an enum or bitmask that cannot fail, we can use it in OCaml for symmetry, so that the result of a get function can be plugged into a set function without manual conversion of an integer. While at it, add an abort() if OCaml ever hands us a value we can't translate to a C int (that one is unreachable per OCaml type safety), or
2020 Sep 07
1
Re: [libnbd PATCH 1/3] generator: Introduce REnum/RFlags return types
On Mon, Sep 07, 2020 at 09:38:15AM -0500, Eric Blake wrote: > On 9/7/20 9:13 AM, Richard W.M. Jones wrote: > > >>+++ b/generator/C.ml > >>@@ -66,15 +66,15 @@ let errcode_of_ret = > >> function > >> | RBool | RErr | RFd | RInt | RInt64 | RCookie -> Some "-1" > >> | RStaticString | RString -> Some "NULL" >
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 Sep 07
0
Re: [libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters
On Sat, Sep 05, 2020 at 08:40:57PM -0500, Eric Blake wrote: > Natural fallout after my recent testsuite additions that fixed a > couple of ocaml bugs in the setters. However, on at least the OCaml > code, I'm not sure what we should do if a newer libnbd ever returns a > bit that an older NBD.mli was not expecting at the time the OCaml > compiler ran (see below). I'm also
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 Sep 11
0
[libnbd PATCH v2 1/5] api: Add xxx_MASK constant for each Flags type
Document and make it easier for applications to determine which bitmask values were supported at compile time. Also, generating bitmask values in hex tends to be more legible than in decimal, as it makes it obvious that the values are intended for bitwise operations. And it doesn't hurt that this reduces churn in some of the tests if new bits are added. --- docs/libnbd.pod
2020 Sep 07
0
Re: [libnbd PATCH 1/3] generator: Introduce REnum/RFlags return types
On 9/7/20 9:13 AM, Richard W.M. Jones wrote: >> +++ b/generator/C.ml >> @@ -66,15 +66,15 @@ let errcode_of_ret = >> function >> | RBool | RErr | RFd | RInt | RInt64 | RCookie -> Some "-1" >> | RStaticString | RString -> Some "NULL" >> - | RUInt -> None (* errors not possible *) >> + | RUInt | REnum (_) | RFlags
2019 Aug 31
1
[PATCH libnbd] Add bindings for Rust language
Still not working, but I took the latest patch and: - rebased it against libnbd 1.0 - fixed it so it handles new args and cbargs The generator now runs without warnings. This patch doesn't handle optargs at all. In C these are converted to non-optional parameter. Rust doesn't (AFAIK) have optional or labelled arguments unfortunately. Rich.
2019 Aug 14
4
[PATCH libnbd 0/2] Use free callback to dereference NBD.Buffer.
In this patch series we use the newly introduced free callback on the completion function to dererence the OCaml NBD.Buffer. I will make the same kind of change for Python later in a separate series. The completion function is always called at the C level, even if the OCaml program didn't use the optional argument. That's because the free callback doesn't run otherwise. There is a
2019 Oct 04
4
[PATCH libnbd 1/4] generator: Allow long ‘name - shortdesc’ in man pages.
For commands with long names and/or short descriptors, you can end up going over 72 characters in the first line of the man page (causing podwrapper to complain). Wrap these lines. --- generator/generator | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generator/generator b/generator/generator index 7d3f656..ad1cb6b 100755 --- a/generator/generator +++ b/generator/generator
2019 Aug 13
12
[PATCH 0/6] Implement OClosure.
Patches 1-4 are basically uncontroversial, straightforward refactoring and IMHO we should just push them. Possibly 1-3 should be squashed together, but I posted them separately so they are easier to review. Patches 5 and 6 together implement OClosure. Patch 5 adds the feature and is simple to understand. Patch 6 changes the Closure completion callbacks into OClosure, but because it doesn't
2020 Mar 17
5
[PATCH libnbd v2 0/3] Unfinished golang bindings.
These bindings get as far as running very simple connections. However there are many missing parts still: * No callbacks. * No functions which handle buffers (pread/pwrite!) This is posted just for general early interest, not even for review. Rich.
2022 Nov 14
3
[cross-project PATCH v2] NBD 64-bit extensions
This is a cover letter for a set of multi-project patch series all designed to implement 64-bit operations in NBD, and demonstrate interoperability of the new extension between projects. v1 of the project was attempted nearly a year ago: https://lists.nongnu.org/archive/html/qemu-devel/2021-12/msg00453.html Since then, I've addressed a lot of preliminary cleanups in libnbd to make it easier