search for: default_call

Displaying 20 results from an estimated 140 matches for "default_call".

2019 Aug 13
0
[PATCH libnbd 1/6] generator: Share single list of all Closures.
...rgs have the same parameter name whichever method they appear in. An alternate refactoring could work the same way as Flags and Enum where the parameter name is part of the arg, eg: type arg = ... | Closure of string * closure (* name, type *) ... "set_debug_callback", { default_call with args = [ Closure ("debug", debug_closure) ]; So after this change, Closure, Flags, and Enum aren't quite congruent. --- generator/generator | 127 ++++++++++++++------------------------------ 1 file changed, 41 insertions(+), 86 deletions(-) diff --git a/generator/generato...
2019 May 30
3
[PATCH libnbd 0/2] Avoid lock and error overhead on some calls.
This works. I'm in the middle of testing whether there is any noticable benefit. Rich.
2020 Sep 11
0
[libnbd PATCH v2 2/5] generator: Refactor filtering of accepted OFlags
...= | UInt64 of string and optarg = | OClosure of closure -| OFlags of string * flags +| OFlags of string * flags * string list option and ret = | RBool | RStaticString @@ -1485,7 +1485,11 @@ Future NBD extensions may result in additional C<size_type> values. "pread", { default_call with args = [ BytesOut ("buf", "count"); UInt64 "offset" ]; - optargs = [ OFlags ("flags", cmd_flags) ]; + (* We could silently accept flag DF, but it really only makes sense + * with callbacks, because otherwise there is no observable change +...
2019 May 28
0
[PATCH] api: Add a special type for the flags argument.
...ing void *) +| Flags of string (* NBD_CMD_FLAG_* flags *) | Int of string (* small int *) | Int64 of string (* 64 bit signed int *) | Opaque of string (* opaque object, void* in C *) @@ -1225,7 +1226,7 @@ with the server."; "pread", { default_call with - args = [ BytesOut ("buf", "count"); UInt64 "offset"; UInt32 "flags" ]; + args = [ BytesOut ("buf", "count"); UInt64 "offset"; Flags "flags" ]; ret = RErr; shortdesc = "read from the NBD serve...
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
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...1 lsl 1; + "DF", 1 lsl 2; + "REQ_ONE", 1 lsl 3; + ] +} +let all_flags = [ cmd_flags ] + (* Calls. * * The first parameter [struct nbd_handle *nbd] is implicit. @@ -1387,7 +1403,7 @@ Returns the size in bytes of the NBD export." "pread", { default_call with args = [ BytesOut ("buf", "count"); UInt64 "offset" ]; - optargs = [ OFlags "flags" ]; + optargs = [ OFlags ("flags", cmd_flags) ]; ret = RErr; permitted_states = [ Connected ]; shortdesc = "read from the NBD serv...
2019 Aug 13
0
[PATCH libnbd 6/6] lib: Make all completion callbacks into OClosures.
...| 5 +-- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/generator/generator b/generator/generator index 3add9a4..7f20950 100755 --- a/generator/generator +++ b/generator/generator @@ -1836,9 +1836,8 @@ C<nbd_pread>."; "aio_pread_callback", { default_call with - args = [ BytesPersistOut ("buf", "count"); UInt64 "offset"; - Closure completion_closure ]; - optargs = [ OFlags ("flags", cmd_flags) ]; + args = [ BytesPersistOut ("buf", "count"); UInt64 "offset" ];...
2019 Aug 13
0
[PATCH libnbd v2 2/3] lib: Make all completion callbacks into OClosures.
...| 5 +-- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/generator/generator b/generator/generator index 8f15786..6ccfc5f 100755 --- a/generator/generator +++ b/generator/generator @@ -1836,9 +1836,8 @@ C<nbd_pread>."; "aio_pread_callback", { default_call with - args = [ BytesPersistOut ("buf", "count"); UInt64 "offset"; - Closure completion_closure ]; - optargs = [ OFlags ("flags", cmd_flags) ]; + args = [ BytesPersistOut ("buf", "count"); UInt64 "offset" ];...
2019 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...* return a boolean, or error *) | RStaticString (* return a static string (must be located in @@ -895,7 +897,7 @@ and permitted_state = not including CLOSED or DEAD *) | Closed | Dead (* can be called when the handle is CLOSED or DEAD *) -let default_call = { args = []; ret = RErr; +let default_call = { args = []; optargs = []; ret = RErr; shortdesc = ""; longdesc = ""; permitted_states = []; is_locked = true; may_set_error = true; @@ -1384,7 +1386,8 @@ Returns the...
2019 Aug 09
4
[PATCH libnbd 0/2] generator: Preparatory changes to the generator.
These are some simplifications to the generator. They don't probably make much sense on their own, but they are preparatory to better handling of enums, and or'd lists of flags. Rich.
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
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 Sep 04
2
[libnbd PATCH] api: Add way to avoid structured replies
...Global flags from the server. */ diff --git a/generator/generator b/generator/generator index 1cc5c19..5c32afa 100755 --- a/generator/generator +++ b/generator/generator @@ -1243,6 +1243,36 @@ Get the current TLS PSK filename."; }; *) + "set_request_structured_replies", { + default_call with + args = [Bool "request"]; ret = RErr; + permitted_states = [ Created ]; + first_version = (1, 2); + shortdesc = "control use of structured replies"; + longdesc = "\ +By default, libnbd tries to negotiate structured replies with the +server, as this prot...
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...ntf (stderr, "%s\n", nbd_get_error ()); goto error; diff --git a/generator/generator b/generator/generator index d76eeea..b713b43 100755 --- a/generator/generator +++ b/generator/generator @@ -1829,108 +1829,60 @@ on the connection."; }; "aio_pread", { - default_call with - args = [ BytesPersistOut ("buf", "count"); UInt64 "offset" ]; - optargs = [ OFlags ("flags", cmd_flags) ]; - ret = RInt64; - permitted_states = [ Connected ]; - shortdesc = "read from the NBD server"; - longdesc = "\ -I...
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
2019 Jul 16
2
[PATCH libnbd] generator: Define new Closure type
** INCOMPLETE ** This is the generator change as discussed on the list already. The Python and OCaml bindings are not yet done. It passes all [C only] tests and valgrind. Note that nbd_add_close_callback is inconsistent with other closure types because it passes the user_data parameter after the function. (This is not caused by the current patch, it was already inconsistent). We decided that
2019 Aug 13
2
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
This applies on top of the OClosure v2 series posted a few minutes ago. Rich.
2019 Aug 13
7
[PATCH libnbd v2 0/3] Implement OClosures.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-August/msg00168.html I pushed uncontroversial patches 1-4 v2: - The implementation of OClosure (new patch 1) in Python is fixed. - Patch 2 (old patch 5) is unchanged. - I added a new API for removing debug callbacks. I think this approach has some advantages over using OClosure. - I didn't yet do any work on changing the
2019 Aug 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...ike UInt64 *) and permitted_state = | Created (* can be called in the START state *) | Connecting (* can be called when connecting/handshaking *) @@ -932,7 +939,7 @@ Return the state of the debug flag on this handle."; "set_debug_callback", { default_call with args = [ Closure { cbname="debug"; - cbargs=[String "context"; String "msg"] } ]; + cbargs=[CBString "context"; CBString "msg"] } ]; ret = RErr; shortdesc = "set the debug callback...
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...persists *) | Path of string (* filename or path *) | SockAddrAndLen of string * string (* struct sockaddr * + socklen_t *) | String of string (* string *) @@ -915,9 +923,10 @@ Return the state of the debug flag on this handle."; "set_debug_callback", { default_call with - args = [ Opaque "data"; - CallbackPersist ("debug_fn", [Opaque "data"; - String "context"; String "msg"]) ]; + args = [ OpaqueAndCallbacksPersist ("data", +...