From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Fabiano Rosas <farosas@suse.de>,
peterx@redhat.com
Subject: [PATCH for-12.0 0/6] migration: Remove VMSTATE_VALIDATE() and VMS_MUST_EXIST
Date: Fri, 20 Nov 2026 07:49:17 -0500 [thread overview]
Message-ID: <20261120124923.1656220-1-peterx@redhat.com> (raw)
CI: https://gitlab.com/peterx/qemu/-/pipelines/3091862038
This is for QEMU 12.0 material only. I could have marked this RFC, but I
found that I want / see this more than "request for comments", so I send it
as formal patches.
To PeterM: I know you may still have some concern on dropping VALIDATE, but
until now I still think this should be the right thing to do. Let's move
the discussion here and we can continue discussions here.
===8<===
Peter Maydell reported an unwanted assertion on source QEMU due to a failed
check in VMSTATE_VALIDATE():
https://lore.kernel.org/r/20261119165546.3050013-1-peter.maydell@linaro.org
I decided to look at this in a slightly broader range, because I always
thought hijacking field_exists() is very error prone and hard to follow,
and VMSTATE_VALIDATE() is the only user of it (VMS_MUST_EXIST). Meanwhile
it is the only VMSTATE_*() macro that does not carry a real entity of data
stream, so it's not really a FIELD, but some checker we added adhoc inline
into the VMSD fields. It might be confusing to anyone new reading VMSD
code, including myself when reading it first time.
Instead of updating the source behavior, let's directly wipe that code out.
I think it's not making a lot of sense doing device state check in save(),
because those sanity check should be done in emulation code, not after
seding all RAM, which is extremely awkward. post_load() OTOH still makes
some sense to sanity check fields, so I moved all VALIDATE there.
Any comment welcomed, thanks.
Peter Xu (6):
pcie/aer: Remove the usage of VMSTATE_VALIDATE()
hw/gpio/zaurus: Move VMSTATE_VALIDATE() check into post_load_errp()
hpet: Move VMSTATE_VALIDATE() check into post_load
arm/machine: Move all VMSTATE_VALIDATE() usages into post_load
rust: Replace vmstate_validate with post_load
migration: Drop VMSTATE_VALIDATE() and VMS_MUST_EXIST
include/migration/vmstate.h | 11 -----
hw/gpio/zaurus.c | 29 ++++++------
hw/pci/pcie_aer.c | 40 ++++++++++++++--
hw/timer/hpet.c | 18 ++++----
migration/savevm.c | 5 --
migration/vmstate.c | 12 -----
target/arm/machine.c | 45 ++++++++++++++++--
rust/hw/timer/hpet/src/device.rs | 9 ++--
rust/migration/src/prelude.rs | 1 -
rust/migration/src/vmstate.rs | 17 -------
rust/tests/tests/vmstate_tests.rs | 77 -------------------------------
11 files changed, 106 insertions(+), 158 deletions(-)
--
2.56.0
next reply other threads:[~2026-11-20 12:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 12:49 Peter Xu [this message]
2026-11-20 12:49 ` [PATCH for-12.0 1/6] pcie/aer: Remove the usage of VMSTATE_VALIDATE() Peter Xu
2026-11-20 12:49 ` [PATCH for-12.0 2/6] hw/gpio/zaurus: Move VMSTATE_VALIDATE() check into post_load_errp() Peter Xu
2026-11-20 12:49 ` [PATCH for-12.0 3/6] hpet: Move VMSTATE_VALIDATE() check into post_load Peter Xu
2026-11-20 12:49 ` [PATCH for-12.0 4/6] arm/machine: Move all VMSTATE_VALIDATE() usages " Peter Xu
2026-11-20 12:49 ` [PATCH for-12.0 5/6] rust: Replace vmstate_validate with post_load Peter Xu
2026-11-20 14:25 ` Zhao Liu
2026-11-20 15:43 ` Peter Xu
2026-11-20 12:49 ` [PATCH for-12.0 6/6] migration: Drop VMSTATE_VALIDATE() and VMS_MUST_EXIST Peter Xu
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=20261120124923.1656220-1-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=farosas@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.