From: Paolo Bonzini <pbonzini@redhat.com>
To: Martin Kletzander <mkletzan@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
"open list:Block layer core" <qemu-block@nongnu.org>,
Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
qemu-rust@nongnu.org, Hanna Reitz <hreitz@redhat.com>,
Kevin Wolf <kwolf@redhat.com>
Subject: Re: [PATCH 1/2] rust: Add antoher variant for impl_vmstate_struct! macro
Date: Mon, 4 Aug 2025 12:08:15 +0200 [thread overview]
Message-ID: <CABgObfaivWp1v55KHjBK1Ba8fDgo3Lr+wF5HkHrvOz62Z_gLoQ@mail.gmail.com> (raw)
In-Reply-To: <aJB1oeH2eTIeeJne@wheatley.k8r.cz>
[-- Attachment #1: Type: text/plain, Size: 2489 bytes --]
Il lun 4 ago 2025, 10:56 Martin Kletzander <mkletzan@redhat.com> ha scritto:
> *BUT* of course I had to rebase the patches on top of current rust-next
> on Friday and there were some of your commits from Thursday which I now
> see actually fix all what I tried fixing before as well. I tried
> finding the previous commit on which I saw all the issues and after some
> rebuilding I could not. So it is now not even broken on rust-next.
>
> This way I completely wasted your time, but at least learned something
> that's happening in the code. Sorry for that.
>
Uh no you didn't. It was broken.
Paolo
Martin
>
> >Paolo
> >
> > rust/qemu-api/src/vmstate.rs | 11 +++++++++++
> >> rust/qemu-api/tests/vmstate_tests.rs | 1 +
> >> 2 files changed, 12 insertions(+)
> >>
> >> diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-api/src/
> vmstate.rs
> >> index b5c6b764fbba..716e52afe740 100644
> >> --- a/rust/qemu-api/src/vmstate.rs
> >> +++ b/rust/qemu-api/src/vmstate.rs
> >> @@ -449,6 +449,17 @@ macro_rules! vmstate_validate {
> >> /// description of the struct.
> >> #[macro_export]
> >> macro_rules! impl_vmstate_struct {
> >> + ($type:ty, $(&)?$vmsd:ident) => {
> >> + unsafe impl $crate::vmstate::VMState for $type {
> >> + const BASE: $crate::bindings::VMStateField =
> >> + $crate::bindings::VMStateField {
> >> + vmsd: $vmsd.as_ref(),
> >> + size: ::core::mem::size_of::<$type>(),
> >> + flags: $crate::bindings::VMStateFlags::VMS_STRUCT,
> >> + ..$crate::zeroable::Zeroable::ZERO
> >> + };
> >> + }
> >> + };
> >> ($type:ty, $vmsd:expr) => {
> >> unsafe impl $crate::vmstate::VMState for $type {
> >> const BASE: $crate::bindings::VMStateField = {
> >> diff --git a/rust/qemu-api/tests/vmstate_tests.rs
> b/rust/qemu-api/tests/
> >> vmstate_tests.rs
> >> index 2c0670ba0eed..7d3180e6c2ea 100644
> >> --- a/rust/qemu-api/tests/vmstate_tests.rs
> >> +++ b/rust/qemu-api/tests/vmstate_tests.rs
> >> @@ -320,6 +320,7 @@ fn test_vmstate_struct_varray_uint8_wrapper() {
> >> b"arr_a_wrap\0"
> >> );
> >> assert_eq!(foo_fields[5].num_offset, 228);
> >> + assert_eq!(foo_fields[5].vmsd, VMSTATE_FOOA.as_ref());
> >> assert!(unsafe { foo_fields[5].field_exists.unwrap()(foo_b_p, 0)
> });
> >>
> >> // The last VMStateField in VMSTATE_FOOB.
> >> --
> >> 2.50.1
> >>
> >>
>
[-- Attachment #2: Type: text/html, Size: 4499 bytes --]
next prev parent reply other threads:[~2025-08-04 10:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 14:59 [PATCH 0/2] Few fixes I found when building QEMU with Rust Martin Kletzander
2025-08-01 14:59 ` [PATCH 1/2] rust: Add antoher variant for impl_vmstate_struct! macro Martin Kletzander
2025-08-01 21:44 ` Paolo Bonzini
2025-08-04 8:56 ` Martin Kletzander
2025-08-04 10:08 ` Paolo Bonzini [this message]
2025-08-04 12:04 ` Martin Kletzander
2025-08-04 13:06 ` Paolo Bonzini
2025-08-01 14:59 ` [PATCH 2/2] tests/qemu-iotests: Indent expected error messages Martin Kletzander
2025-08-01 15:48 ` Daniel P. Berrangé
2025-08-01 19:09 ` Fabiano Rosas
2025-08-04 8:20 ` Martin Kletzander
2025-08-04 11:33 ` Kevin Wolf
2025-08-06 6:54 ` Dr. Werner Fink
2025-08-11 9:05 ` Martin Kletzander
2025-08-12 15:35 ` Kevin Wolf
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=CABgObfaivWp1v55KHjBK1Ba8fDgo3Lr+wF5HkHrvOz62Z_gLoQ@mail.gmail.com \
--to=pbonzini@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=mkletzan@redhat.com \
--cc=qemu-block@nongnu.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).