qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] rust: Make common::Wrapper work with non-tuple structs
@ 2025-10-23 13:54 Martin Kletzander
  2025-10-23 13:54 ` [RFC PATCH 1/2] rust: Make common::Wrapper work with non-tuple structs as well Martin Kletzander
  2025-10-23 13:54 ` [RFC PATCH 2/2] rust/util: Change Timer and TimerListGroup to normal structs Martin Kletzander
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Kletzander @ 2025-10-23 13:54 UTC (permalink / raw)
  To: 'Manos Pitsidianakis ', qemu-rust, qemu-devel

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-23 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-23 13:54 [RFC PATCH 0/2] rust: Make common::Wrapper work with non-tuple structs Martin Kletzander
2025-10-23 13:54 ` [RFC PATCH 1/2] rust: Make common::Wrapper work with non-tuple structs as well Martin Kletzander
2025-10-23 13:54 ` [RFC PATCH 2/2] rust/util: Change Timer and TimerListGroup to normal structs Martin Kletzander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).