rust: remaining parts of qdev bindings
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest12 patches 9 repliesIn review
Changes in v1 from the cover letter
- improvements and fixes for docs and comments
- fixed Sync/Send declarations for Owned
- prefer NonNull::cast (could use NonNull<> arguments too in the future)
- add Send markers too, not just Sync
- use impl_zeroable! macro
- add qdev_init_clock_out() too
- add comments about when to use Owned<>
- add Owned::clone
- add conversion of pl011_create to safe Rust for more uses of Owned<>
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | rust: qom: add reference counting functionalityrust/ rust/ rust/ | +172 | 1 reply | |
| 2/12 | rust: qom: add object creation functionalityrust/ rust/ rust/ +1 more | +46 | 1 reply | |
| 3/12 | rust: callbacks: allow passing optional callbacks as ()rust/ | +97 | 1 reply | |
| 4/12 | rust: qdev: add clock creationrust/ rust/ rust/ +1 more | +127 | 1 reply | |
| 5/12 | rust: qom: allow initializing interface vtablesrust/ rust/ | +44 | 0 replies | |
| 6/12 | rust: qdev: make ObjectImpl a supertrait of DeviceImplrust/ | +2 | 0 replies | |
| 7/12 | rust: qdev: switch from legacy reset to Resettablemeson.build rust/ rust/ +1 more | +99 | 1 reply | |
| 8/12 | rust: bindings: add Send and Sync markers for types that have bindingsrust/ rust/ | +49 | 0 replies | |
| 9/12 | rust: bindings for MemoryRegionOpsrust/ rust/ rust/ +5 more | +226 | 1 reply | |
| 10/12 | rust: irq: define ObjectType for IRQStaterust/ | +12 | 1 reply | |
| 11/12 | rust: chardev, qdev: add bindings to qdev_prop_set_chrrust/ rust/ rust/ +2 more | +31 | 1 reply | |
| 12/12 | rust: pl011: convert pl011_create to safe Rustrust/ rust/ | +50 | 1 reply |
Reviews trailers per patch
All 12 patches have a Reviewed-by or Acked-by.
| Patch | Zhao Liu |
|---|---|
| 1/12 | R-b |
| 2/12 | R-b |
| 3/12 | R-b |
| 4/12 | R-b |
| 5/12 | R-b |
| 6/12 | R-b |
| 7/12 | R-b |
| 8/12 | R-b |
| 9/12 | R-b |
| 10/12 | R-b |
| 11/12 | R-b |
| 12/12 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/12] rust: remaining parts of qdev bindings
This concludes the part of the qdev bindings that is needed to convert pl011 to safe Rust, with the exception of chardev bindings and switching to the pinned_init crate.
It includes reference counting, object creation, clocks, Resettable and MemoryRegionOps. Documentation is at least decent.
The code is getting closer to the synopsis at
https://lists.nongnu.org/archive/html/qemu-rust/2024-12/msg00006.html,
except that it works (at least as far as CI is concerned) instead of just compiling. :) And since I'm citing it, a reminder that it may still be worth asking your Rust questions as replies to that message.
You can find the code in the rust-next branch of
https://gitlab.com/bonzini/qemu/.
Paolo
RFC->v1:
- improvements and fixes for docs and comments
- fixed Sync/Send declarations for Owned
- prefer NonNull::cast (could use NonNull<> arguments too in the future)
- add Send markers too, not just Sync
- use impl_zeroable! macro
- add qdev_init_clock_out() too
- add comments about when to use Owned<>
- add Owned::clone
- add conversion of pl011_create to safe Rust for more uses of Owned<>
Paolo Bonzini (12):
rust: qom: add reference counting functionality
rust: qom: add object creation functionality
rust: callbacks: allow passing optional callbacks as ()
rust: qdev: add clock creation
rust: qom: allow initializing interface vtables
rust: qdev: make ObjectImpl a supertrait of DeviceImpl
rust: qdev: switch from legacy reset to Resettable
rust: bindings: add Send and Sync markers for types that have bindings
rust: bindings for MemoryRegionOps
rust: irq: define ObjectType for IRQState
rust: chardev, qdev: add bindings to qdev_prop_set_chr
rust: pl011: convert pl011_create to safe Rust
meson.build | 1 + rust/hw/char/pl011/src/device.rs | 121 +++++++------- rust/hw/char/pl011/src/lib.rs | 1 - rust/hw/char/pl011/src/memory_ops.rs | 34 ---- rust/qemu-api/meson.build | 2 + rust/qemu-api/src/bindings.rs | 46 ++++++ rust/qemu-api/src/callbacks.rs | 97 ++++++++++++ rust/qemu-api/src/chardev.rs | 19 +++ rust/qemu-api/src/irq.rs | 18 ++- rust/qemu-api/src/lib.rs | 2 + rust/qemu-api/src/memory.rs | 191 ++++++++++++++++++++++ rust/qemu-api/src/prelude.rs | 4 + rust/qemu-api/src/qdev.rs | 227 ++++++++++++++++++++++++--- rust/qemu-api/src/qom.rs | 218 ++++++++++++++++++++++++- rust/qemu-api/src/sysbus.rs | 39 ++++- rust/qemu-api/src/vmstate.rs | 10 +- rust/qemu-api/src/zeroable.rs | 1 + rust/qemu-api/tests/tests.rs | 45 +++--- 18 files changed, 924 insertions(+), 152 deletions(-) delete mode 100644 rust/hw/char/pl011/src/memory_ops.rs create mode 100644 rust/qemu-api/src/chardev.rs create mode 100644 rust/qemu-api/src/memory.rs
Signature · 1 line
2.48.1