search for: need_out_label

Displaying 10 results from an estimated 10 matches for "need_out_label".

2019 Aug 10
0
[PATCH libnbd 7/9] generator: On entry to API functions, check Flags and OFlags parameters.
...\n" n mask; + pr " set_error (EINVAL, \"%%s: invalid value for flag: %%d\",\n"; + pr " \"%s\", %s);\n" n n; + pr " ret = %s;\n" value; + pr " goto out;\n"; + pr " }\n"; + need_out_label := true + in List.iter ( function | Enum (n, { enum_prefix; enums }) -> @@ -3708,6 +3721,8 @@ let generate_lib_api_c () = pr " goto out;\n"; pr " }\n"; need_out_label := true + | Flags (n, flags) -> + pri...
2020 Jul 31
1
[libnbd PATCH] generator: Trace return even when in wrong state
...= pr " ret = nbd_unlocked_%s " name; print_arg_list ~wrap:true ~types:false ~handle:true args optargs; pr ";\n"; - if may_set_error then ( - pr "\n"; - print_trace_leave ret; - pr "\n" - ); + pr "\n"; if !need_out_label then pr " out:\n"; + if may_set_error then ( + print_trace_leave ret; + pr "\n" + ); if is_locked then ( pr " if (h->public_state != get_next_state (h))\n"; pr " h->public_state = get_next_state (h);\n"; --...
2019 Aug 10
0
[PATCH libnbd 5/9] generator: On entry to API functions, check Enum parameters.
...pr " set_error (EINVAL, \"%%s: invalid value for parameter: %%d\",\n"; + pr " \"%s\", %s);\n" n n; + pr " ret = %s;\n" value; + pr " goto out;\n"; + pr " }\n"; + need_out_label := true | String n -> let value = match errcode with | Some value -> value -- 2.22.0
2019 Aug 13
0
[PATCH libnbd 4/6] lib: Check Closure parameter is not NULL.
...pr " if (%s_callback == NULL) {\n" cbname; + pr " set_error (EFAULT, \"%%s cannot be NULL\", \"%s\");\n" cbname; + pr " ret = %s;\n" value; + pr " goto out;\n"; + pr " }\n"; + need_out_label := true | Enum (n, { enum_prefix; enums }) -> let value = match errcode with | Some value -> value -- 2.22.0
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 07
0
[libnbd PATCH 1/2] generator: Refactor handling of closures in unlocked functions
...ake the call. *) pr " ret = nbd_unlocked_%s " name; - print_arg_list ~wrap:true ~types:false ~handle:true args optargs; + print_arg_list ~wrap:true ~types:false ~handle:true ~closure_mark:"&" args optargs; pr ";\n"; pr "\n"; if !need_out_label then diff --git a/generator/C.mli b/generator/C.mli index 4f71453..a7e0412 100644 --- a/generator/C.mli +++ b/generator/C.mli @@ -27,6 +27,7 @@ val generate_docs_api_flag_links_pod : unit -> unit val generate_docs_nbd_pod : string -> API.call -> unit -> unit val print_arg_list : ?wrap...
2020 Sep 11
0
[libnbd PATCH v2 2/5] generator: Refactor filtering of accepted OFlags
...pr " set_error (EINVAL, \"%%s: invalid value for flag: 0x%%x\",\n"; pr " \"%s\", %s);\n" n n; pr " ret = %s;\n" value; @@ -536,7 +546,7 @@ let generate_lib_api_c () = pr " }\n"; need_out_label := true | Flags (n, flags) -> - print_flags_check n flags + print_flags_check n flags None | String n -> let value = match errcode with | Some value -> value @@ -552,8 +562,8 @@ let generate_lib_api_c () = List.iter ( function...
2020 Sep 07
4
[libnbd PATCH 0/2] Fix memory leak with closures
As promised in my earlier thread on libnbd completion callback question. Eric Blake (2): generator: Refactor handling of closures in unlocked functions generator: Free closures on failure docs/libnbd.pod | 2 +- generator/C.ml | 48 +++++++++++------ generator/C.mli | 1 + lib/debug.c | 7 +-- lib/opt.c | 31 ++++++-----
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 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