On Wed, Aug 02, 2023 at 12:40:54PM +0000, Tage Johansson wrote:
> All handle calls which has the `modifies_fd` flag set to [true] will be
> excluded from `AsyncHandle` (the asynchronous handle in the rust
> bindings). This is a better approach then listing all calls that should
> be excluded in Rust.ml explicetly.
> ---
>  generator/Rust.ml | 63 ++++++++++++++++++++++-------------------------
>  1 file changed, 30 insertions(+), 33 deletions(-)
> 
> diff --git a/generator/Rust.ml b/generator/Rust.ml
> index dc82d46..5d26c73 100644
> --- a/generator/Rust.ml
> +++ b/generator/Rust.ml
> @@ -567,19 +567,21 @@ let generate_rust_bindings () =
>  (*********************************************************)
>  
>  let excluded_handle_calls : NameSet.t =
> +  let modifies_fd =

Reusing 'modifies_fd' as the variable containing a list of synchronous
calls is a bit confusing.  How about just using this code directly
when creating the set, eg:

NameSet.of_list
   ([
     "aio_get_fd";
     "aio_get_direction";
      ...
    ] @
    handle_calls
    |> List.filter (fun (_, { modifies_fd }) -> modifies_fd)
    |> List.map (fun (name, _) -> name)
  )

or using NameSet.union?

Some of the code in the rest of this patch uses Set or Map sequences
which don't work with OCaml 4.05 (RHEL 7).  We're slowly dropping
support for RHEL 7 so this is not necessarily a blocker, but if it was
easy to change the code so it would still work that might be better.

Everything must work with RHEL 8 (OCaml 4.07).

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to