Re: [PATCH 06/10] rust: add bindings for timer

2025-01-29 Thread Paolo Bonzini
On Sat, Jan 25, 2025 at 1:32 PM Zhao Liu wrote: + c_nocopy = [ +'QEMUTimer', + ] + # Used to customize Drop trait + foreach struct : c_nocopy +bindgen_args += ['--no-copy', struct] + endforeach Nice. +pub use bindings::QEMUTimer; + +use crate::{ +bindings::{ +self

[PATCH 06/10] rust: add bindings for timer

2025-01-25 Thread Zhao Liu
Add timer bindings to help handle idiomatic Rust callbacks. Additionally, wrap QEMUClockType in ClockType binding to avoid unsafe calls in device code. Signed-off-by: Zhao Liu --- Changes since RFC: * Use FnCall to support timer callback. * Only add timer_init_full() binding. timer_new() is un