qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Martin Kletzander <mkletzan@redhat.com>
To: 'Manos Pitsidianakis ' <manos.pitsidianakis@linaro.org>,
	qemu-rust@nongnu.org, qemu-devel@nongnu.org
Subject: [RFC PATCH 0/2] rust: Make common::Wrapper work with non-tuple structs
Date: Thu, 23 Oct 2025 15:54:07 +0200	[thread overview]
Message-ID: <cover.1761226974.git.mkletzan@redhat.com> (raw)

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



             reply	other threads:[~2025-10-23 13:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23 13:54 Martin Kletzander [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1761226974.git.mkletzan@redhat.com \
    --to=mkletzan@redhat.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).