[RFC PATCH 0/2] rust: Make common::Wrapper work with non-tuple structs

Martin Kletzander posted 2 patches 3 days, 18 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/cover.1761226974.git.mkletzan@redhat.com
Maintainers: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
rust/qemu-macros/src/lib.rs | 49 ++++++++++++++++++++++++++++---------
rust/util/src/timer.rs      | 10 +++++---
2 files changed, 44 insertions(+), 15 deletions(-)
[RFC PATCH 0/2] rust: Make common::Wrapper work with non-tuple structs
Posted by Martin Kletzander 3 days, 18 hours ago
As part of my "investigation" [0] into safer object initialization using
pinned-init, I found out that pinned-init will probably not work with tuple
structs for some time [1].  So I figured out how to change QEMU's Wrapper derive
macro so that both tuple structs and classic structs (still `#[repr(transparent)]`
and having only one member) are supported.

The second patch is there just to show that it works, I also checked the result
with `cargo expand` to make sure.

This is just to see if the patch makes sense the way it is.  I'm still trying to
see the best way forward with this pinning effort.  Many thanks for Paolo's
patience with me.  I'm using what I learn to also try and make a proof of
concept of something similar to the RustInQEMU effort (although way smaller in
scope) in libvirt, so it takes a bit more time.

[0] read: learning QEMU internals and possible Rust usage
[1] https://github.com/Rust-for-Linux/pin-init/issues/85

Martin Kletzander (2):
  rust: Make common::Wrapper work with non-tuple structs as well
  rust/util: Change Timer and TimerListGroup to normal structs

 rust/qemu-macros/src/lib.rs | 49 ++++++++++++++++++++++++++++---------
 rust/util/src/timer.rs      | 10 +++++---
 2 files changed, 44 insertions(+), 15 deletions(-)

-- 
2.51.0