As explained for v1, the impetus for this series is to remove BqlCell<> from HPETState::num_timers. However, it's also an important step for QAPI: error propagation is pretty central for example to QMP, and the series is also a first example of two-way conversion between C and native-Rust structs (i.e. not using bindgen-generated structs or their opaque wrappers).
The differences from v2 and v3 are: * documentation * correctly using error_propagate() * panicking on errors with no message and no cause Based-on: <20250603214523.131185-1-pbonz...@redhat.com> Paolo Bonzini (13): subprojects: add the anyhow crate subprojects: add the foreign crate util/error: expose Error definition to Rust code util/error: allow non-NUL-terminated err->src util/error: make func optional rust: qemu-api: add bindings to Error rust: qemu-api: add tests for Error bindings rust: qdev: support returning errors from realize rust/hpet: change type of num_timers to usize hpet: adjust VMState for consistency with Rust version hpet: return errors from realize if properties are incorrect rust/hpet: return errors from realize if properties are incorrect docs: update Rust module status Zhao Liu (1): rust/hpet: Drop BqlCell wrapper for num_timers docs/devel/rust.rst | 7 +- include/qapi/error-internal.h | 35 ++ rust/wrapper.h | 1 + hw/timer/hpet.c | 21 +- util/error.c | 20 +- rust/Cargo.lock | 17 + rust/Cargo.toml | 1 + rust/hw/char/pl011/src/device.rs | 5 +- rust/hw/timer/hpet/src/device.rs | 62 ++- rust/hw/timer/hpet/src/fw_cfg.rs | 7 +- rust/meson.build | 4 + rust/qemu-api/Cargo.toml | 2 + rust/qemu-api/meson.build | 3 +- rust/qemu-api/src/error.rs | 416 ++++++++++++++++++ rust/qemu-api/src/lib.rs | 3 + rust/qemu-api/src/qdev.rs | 10 +- scripts/archive-source.sh | 5 +- scripts/make-release | 5 +- subprojects/.gitignore | 2 + subprojects/anyhow-1-rs.wrap | 7 + subprojects/foreign-0.3-rs.wrap | 7 + .../packagefiles/anyhow-1.0-rs/meson.build | 33 ++ .../packagefiles/foreign-0.3-rs/meson.build | 26 ++ 23 files changed, 628 insertions(+), 71 deletions(-) create mode 100644 include/qapi/error-internal.h create mode 100644 rust/qemu-api/src/error.rs create mode 100644 subprojects/anyhow-1-rs.wrap create mode 100644 subprojects/foreign-0.3-rs.wrap create mode 100644 subprojects/packagefiles/anyhow-1.0-rs/meson.build create mode 100644 subprojects/packagefiles/foreign-0.3-rs/meson.build -- 2.49.0