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 6/6] migration: Drop VMSTATE_VALIDATE() and VMS_MUST_EXIST
Date: Fri, 20 Nov 2026 07:49:23 -0500 [thread overview]
Message-ID: <20261120124923.1656220-7-peterx@redhat.com> (raw)
In-Reply-To: <20261120124923.1656220-1-peterx@redhat.com>
We have moved all users to other API, now they're never used.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
include/migration/vmstate.h | 11 -----------
migration/savevm.c | 5 -----
migration/vmstate.c | 12 ------------
3 files changed, 28 deletions(-)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 2901877308..de7a957140 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -130,10 +130,6 @@ enum VMStateFlags {
* allocated. Only valid in combination with VMS_VBUFFER. */
VMS_MULTIPLY = 0x200,
- /* Fail loading the serialised VM state if this field is missing
- * from the input. */
- VMS_MUST_EXIST = 0x1000,
-
/* When loading serialised VM state, allocate memory for the
* (entire) field. Only valid in combination with
* VMS_POINTER. Note: Not all combinations with other flags are
@@ -458,13 +454,6 @@ extern const VMStateInfo vmstate_info_g_byte_array;
.offset = vmstate_offset_value(_state, _field, _type), \
}
-/* Validate state using a boolean predicate. */
-#define VMSTATE_VALIDATE(_name, _test) { \
- .name = (_name), \
- .field_exists = (_test), \
- .flags = VMS_MUST_EXIST | VMS_NO_STATE, \
-}
-
#define VMSTATE_POINTER(_field, _state, _version, _info, _type) { \
.name = (stringify(_field)), \
.version_id = (_version), \
diff --git a/migration/savevm.c b/migration/savevm.c
index fe94ba96e4..e4f614cc86 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -622,11 +622,6 @@ static void dump_vmstate_vmsd(FILE *out_file,
fprintf(out_file, ",\n%*s\"Fields\": [\n", indent, "");
first = true;
while (field->name != NULL) {
- if (field->flags & VMS_MUST_EXIST) {
- /* Ignore VMSTATE_VALIDATE bits; these don't get migrated */
- field++;
- continue;
- }
if (!first) {
fprintf(out_file, ",\n");
}
diff --git a/migration/vmstate.c b/migration/vmstate.c
index 24004565bf..7734caab06 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -116,8 +116,6 @@ static uint64_t vmstate_n_elems(void *opaque, const VMStateField *field)
n_elems = field->num;
} else if (field->flags & VMS_VARRAY) {
n_elems = vmstate_read_from_offset(&field->num_indirect, opaque);
- } else if (field->flags & VMS_MUST_EXIST && field->flags & VMS_NO_STATE) {
- n_elems = 0;
} else {
n_elems = 1;
}
@@ -430,10 +428,6 @@ bool vmstate_load_vmsd(QEMUFile *f, const VMStateDescription *vmsd,
return false;
}
}
- } else if (field->flags & VMS_MUST_EXIST) {
- error_setg(errp, "Input validation failed: %s/%s version_id: %d",
- vmsd->name, field->name, vmsd->version_id);
- return false;
}
field++;
}
@@ -810,12 +804,6 @@ static bool vmstate_save_vmsd_v(QEMUFile *f, const VMStateDescription *vmsd,
vmdesc_loop = NULL;
}
}
- } else {
- if (field->flags & VMS_MUST_EXIST) {
- error_report("Output state validation failed: %s/%s",
- vmsd->name, field->name);
- assert(!(field->flags & VMS_MUST_EXIST));
- }
}
field++;
}
--
2.56.0
prev parent reply other threads:[~2026-11-20 12:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 12:49 [PATCH for-12.0 0/6] migration: Remove VMSTATE_VALIDATE() and VMS_MUST_EXIST Peter Xu
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 ` Peter Xu [this message]
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-7-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.