search for: handle_calls

Displaying 20 results from an estimated 57 matches for "handle_calls".

2019 Sep 05
0
[PATCH libnbd] generator: Move first_version fields to a single table.
...sion", (1, 0); + "kill_subprocess", (1, 0); + "supports_tls", (1, 0); + "supports_uri", (1, 0); + + (* Added in 1.1 development series. *) + "can_fast_zero", (1, 2); ] (* Constants, etc. *) @@ -3336,13 +3423,37 @@ let () = | _ -> () ) handle_calls; - (* First stable version must be 1.x where x is even. *) + (* first_version must be (0, 0) in handle_calls (we will modify it). *) List.iter ( - fun (name, { first_version = (major, minor) }) -> - if major <> 1 then - failwithf "%s: first_version must be 1.x&qu...
2019 Sep 05
3
[PATCH libnbd] generator: Move first_version fields to a single table.
This doesn't include Eric's new APIs, but if you push those then I can rebase this one on top. Rich.
2019 Aug 10
0
[PATCH libnbd 1/5] python: Change aio_buffer into nbd.Buffer class.
...n () pr "extern PyObject *nbd_internal_py_%s (PyObject *self, PyObject *args);\n" name; ) ([ "create"; "close"; - "alloc_aio_buffer"; "aio_buffer_from_bytearray"; - "aio_buffer_to_bytearray" ] @ List.map fst handle_calls); + "alloc_aio_buffer"; + "aio_buffer_from_bytearray"; + "aio_buffer_to_bytearray"; + "aio_buffer_size" ] @ List.map fst handle_calls); pr "\n"; pr "#endif /* LIBNBD_METHODS_H */\n" @@ -4009,8 +4011,10 @@ le...
2019 Aug 10
7
[PATCH libnbd 0/5] WIP: python: Add test for doing asynch copy.
This doesn't yet work. However it does make me more convinced than ever that we really need to sort out persistent buffer lifetimes in the library (similar to what we did for closures). Rich.
2019 Jul 27
3
[PATCH libnbd] lib: Use symbol versions.
This patch adds support for symbol versions. It is based on what libvirt does. The generated syms file looks like: LIBNBD_1.0 { global: nbd_...; nbd_...; local: *; }; In a future stable 1.2 release, new symbols would go into a new section which would look like this: LIBNBD_1.2 { global: nbd_new_symbol; nbd_another_new_symbol; local: *; } LIBNBD_1.0; In my testing the
2019 Aug 13
0
[PATCH libnbd 1/6] generator: Share single list of all Closures.
...Closure extent_closure; Closure completion_closure ]; optargs = [ OFlags ("flags", cmd_flags) ]; ret = RInt64; permitted_states = [ Connected ]; @@ -3207,30 +3194,6 @@ let () = failwithf "%s: optargs can only be empty list or [OFlags]" name ) handle_calls; - (* Closures must be uniquely named across all calls. *) - let () = - let all_args = - List.flatten (List.map (fun (_, { args }) -> args) handle_calls) in - let h = Hashtbl.create 13 in - List.iter ( - function - | Closure { cbname; cbargs } -> - (try -...
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.
2019 Aug 15
0
[PATCH libnbd v2 10/10] generator: Check requirements for BytesPersistIn/Out and completion callbacks.
...2bdb..13cb0b9 100755 --- a/generator/generator +++ b/generator/generator @@ -3121,6 +3121,31 @@ let () = failwithf "%s: first_version must be 1.x" name; if minor mod 2 <> 0 then failwithf "%s: first_version must refer to a stable release" name + ) handle_calls; + + (* Because of the way we use completion free callbacks to + * free persistent buffers in non-C languages, any function + * with a BytesPersistIn/Out parameter must have only one. + * And it must have an OClosure completion optarg. + *) + List.iter ( + fun (name, { args; optargs })...
2020 Jan 30
2
[PATCH libnbd] python: Add AIO buffer is_zero method.
...31fe9dd..20fd872 100755 --- a/generator/generator +++ b/generator/generator @@ -5014,7 +5014,8 @@ raise_exception () "alloc_aio_buffer"; "aio_buffer_from_bytearray"; "aio_buffer_to_bytearray"; - "aio_buffer_size" ] @ List.map fst handle_calls); + "aio_buffer_size"; + "aio_buffer_is_zero" ] @ List.map fst handle_calls); pr "\n"; pr "#endif /* LIBNBD_METHODS_H */\n" @@ -5044,7 +5045,8 @@ let generate_python_libnbdmod_c () = "alloc_aio_buffer"; "aio_...
2019 Jun 29
1
Re: [libnbd PATCH 5/6] api: Add new nbd_aio_FOO_notify functions
...gdesc } let aio_pwrite_call = { default_call with args = [ BytesPersistIn ("buf", "count"); UInt64 "offset"; Flags "flags" ]; ] (* etc copy the definition of aio_pwrite *) } let aio_pwrite_notify_call = make_notify_variant_of_call aio_pwrite_call let handle_calls = [ ... "aio_pwrite", aio_pwrite_call; "aio_pwrite_notify", aio_pwrite_notify_call; ... ] Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk u...
2019 Aug 14
3
[libnbd PATCH 0/2] Drop generated file from git
Rich recently patched things to generate one man page per function rather than libnbd-api.3 (nice), but in doing so got stumped by a problem with a fresh git clone (automake fails for any 'include' directive that does not already exist). I've figured out how to hack around it, but the hack requires GNU make. We already use GNU make constructs elsewhere (such as $(wildcard)), but
2019 Jun 03
1
[libnbd PATCH] generator: Add #define witnesses for all API
...nbd_close_callback cb, void *data);\n"; + pr "#define LIBNBD_HAVE_NBD_ADD_CLOSE_CALLBACK 1\n"; pr "\n"; List.iter ( - fun (name, { args; ret }) -> print_extern name args ret + fun (name, { args; ret }) -> print_extern_and_define name args ret ) handle_calls; pr "\n"; pr "#endif /* LIBNBD_H */\n" @@ -2933,6 +2948,13 @@ in detail. If you want an overview of using the API, or to see how to call the API from other programming languages, start with libnbd(3). +For the sake of conditional compilation across a range of libnbd +v...
2020 Sep 07
0
[libnbd PATCH v2 3/3] ocaml: Typesafe returns for REnum/RFlags
...s } = pr "\n"; pr " return r;\n"; pr "}\n"; - pr "\n" + pr "\n"; + if List.exists ( + function + | _, { ret = REnum { enum_prefix = prefix } } -> + (prefix = enum_prefix) + | _ -> false + ) handle_calls then ( + pr "/* Convert int to OCaml %s.t. */\n" enum_prefix; + pr "static value\n"; + pr "Val_%s (int i)\n" enum_prefix; + pr "{\n"; + pr " CAMLparam0 ();\n"; + pr " CAMLlocal1 (rv);\n"; + pr "\n"; + pr...
2019 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...failwithf "%s: Flags must appear in final argument position only" - name + function + | _, { optargs = [] } | _, { optargs = [OFlags _] } -> () + | (name, _) -> + failwithf "%s: optargs can only be empty list of [OFlags]" name ) handle_calls; (* Closures must be uniquely named across all calls. *) @@ -3292,7 +3301,6 @@ let rec name_of_arg = function | BytesPersistOut (n, len) -> [n; len] | Closure { cbname } -> [ sprintf "%s_callback" cbname; sprintf "%s_user_data" cbname ] -| Flags n -> [n] | I...
2019 Aug 03
1
[PATCH libnbd] generator: Generate typedefs automatically for Closure arguments.
...l >= 4.04. + *) +let sort_uniq ?(cmp = Pervasives.compare) xs = + let xs = List.sort cmp xs in + let xs = uniq ~cmp xs in + xs + let chan = ref Pervasives.stdout let pr fs = ksprintf (fun str -> output_string !chan str) fs @@ -3100,6 +3119,30 @@ let () = name ) handle_calls; + (* Closures must be uniquely named across all calls. *) + let () = + let all_args = + List.flatten (List.map (fun (_, { args }) -> args) handle_calls) in + let h = Hashtbl.create 13 in + List.iter ( + function + | Closure { cbname; cbargs } -> + (try +...
2019 Jul 07
2
[libnbd PATCH] RFC: Add bindings for Rust language
...s: if may_set_error is false, permitted_states must be empty (any permitted state)" name + | name, { ret = RErr; may_set_error = false } -> + failwithf "%s: if ret is RErr, then may_set_error cannot be false" + name | _ -> () ) handle_calls @@ -4652,6 +4655,302 @@ let generate_ocaml_nbd_c () = List.iter print_ocaml_binding handle_calls +let rec pr_indent = function + | 0 -> () + | n -> pr " "; pr_indent (n - 1) + +let rec print_rust_ffi_arg_list ?(handle = false) indent args = + let pri () = pr_indent in...
2019 Jun 03
3
[PATCH libnbd] api: nbd_get_version, nbd_supports_uri and nbd_get_package_name.
...ame; - ) ([ "create"; "close"; "get_package_name"; "get_package_version"; + ) ([ "create"; "close"; "alloc_aio_buffer"; "aio_buffer_from_bytearray"; "aio_buffer_to_bytearray" ] @ List.map fst handle_calls); @@ -3035,7 +3078,7 @@ let generate_python_libnbdmod_c () = fun name -> pr " { (char *) \"%s\", nbd_internal_py_%s, METH_VARARGS, NULL },\n" name name; - ) ([ "create"; "close"; "get_package_name"; "get_package_ver...
2019 Aug 10
0
[PATCH libnbd 3/9] generator: Add Enum type for enumerated types / unions.
...t; + ) all_enums; List.iter ( fun { flag_prefix; flags } -> pr "module %s = struct\n" flag_prefix; @@ -4874,6 +4946,30 @@ external close : t -> unit = \"nbd_internal_ocaml_nbd_close\" pr "\"nbd_internal_ocaml_nbd_%s\"\n" name ) handle_calls +let print_ocaml_enum_val { enum_prefix; enums } = + pr "/* Convert OCaml %s.t to int. */\n" enum_prefix; + pr "static int\n"; + pr "%s_val (value v)\n" enum_prefix; + pr "{\n"; + pr " CAMLparam1 (v);\n"; + pr " int i, r = 0;\n";...
2019 May 23
2
[PATCH libnbd] api: Get rid of nbd_connection.
This isn't quite finished because not all of the tests or examples have been updated, but it demonstrates an idea: Should we forget about the concept of having multiple connections managed under a single handle? In this patch there is a single ‘struct nbd_handle *’ which manages a single state machine and connection (and therefore no nbd_connection). To connect to a multi-conn server you must
2019 Aug 11
4
[PATCH libnbd v2 0/3] python: Add test for doing asynch copy.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-August/msg00103.html In v2 I've made several changes: - Fix Python callbacks so if they don't return something which is int-like, we assume they mean to return 0. - Add nbd.Buffer free() method. Read commit message in patch 2 to see what this is about. - Fixed the asynch copy test to deal with the unbelievably