From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
"Sebastian Ott" <sebott@redhat.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Fiona Ebner" <f.ebner@proxmox.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Peter Xu" <peterx@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
peter.maydell@linaro.org, "Michael S. Tsirkin" <mst@redhat.com>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PATCH 2/4] include/migration: add VMSTATE_VSTRUCT_TEST_VARRAY_UINT32
Date: Tue, 7 May 2024 15:19:18 +0400 [thread overview]
Message-ID: <20240507111920.1594897-3-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20240507111920.1594897-1-marcandre.lureau@redhat.com>
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Add a macro to declare a VMState field which contains an array of struct
with a specific version.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
include/migration/vmstate.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 294d2d8486..eaff3c8ff2 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -634,6 +634,18 @@ extern const VMStateInfo vmstate_info_qlist;
.offset = vmstate_offset_varray(_state, _field, _type), \
}
+#define VMSTATE_VSTRUCT_TEST_VARRAY_UINT32(_field, _state, _test, _field_num, _version, _vmsd, _type, _struct_version) { \
+ .name = (stringify(_field)), \
+ .version_id = (_version), \
+ .struct_version_id = (_struct_version), \
+ .field_exists = (_test), \
+ .num_offset = vmstate_offset_value(_state, _field_num, uint32_t), \
+ .vmsd = &(_vmsd), \
+ .size = sizeof(_type), \
+ .flags = VMS_VSTRUCT|VMS_VARRAY_UINT32, \
+ .offset = vmstate_offset_varray(_state, _field, _type), \
+}
+
#define VMSTATE_STRUCT_VARRAY_ALLOC(_field, _state, _field_num, _version, _vmsd, _type) {\
.name = (stringify(_field)), \
.version_id = (_version), \
--
2.41.0.28.gd7d8841f67
next prev parent reply other threads:[~2024-05-07 11:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 11:19 [PATCH 0/4] Fix "virtio-gpu: fix scanout migration post-load" marcandre.lureau
2024-05-07 11:19 ` [PATCH 1/4] migration: add "exists" info to load-state-field trace marcandre.lureau
2024-05-07 15:29 ` Peter Xu
2024-05-07 11:19 ` marcandre.lureau [this message]
2024-05-07 11:19 ` [PATCH 3/4] virtio-gpu: use a VMState variant for the scanout field marcandre.lureau
2024-05-07 19:59 ` Peter Xu
2024-05-10 8:39 ` Marc-André Lureau
2024-05-10 17:33 ` Peter Xu
2024-05-11 6:44 ` Marc-André Lureau
2024-05-10 10:25 ` Michael S. Tsirkin
2024-05-10 11:57 ` Marc-André Lureau
2024-05-07 11:19 ` [PATCH 4/4] virtio-gpu: add x-vmstate-version marcandre.lureau
2024-05-07 20:51 ` Fabiano Rosas
2024-05-07 20:46 ` [PATCH 0/4] Fix "virtio-gpu: fix scanout migration post-load" Fabiano Rosas
2024-05-07 21:24 ` Peter Xu
2024-05-08 9:51 ` Fiona Ebner
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=20240507111920.1594897-3-marcandre.lureau@redhat.com \
--to=marcandre.lureau@redhat.com \
--cc=eduardo@habkost.net \
--cc=f.ebner@proxmox.com \
--cc=farosas@suse.de \
--cc=kraxel@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sebott@redhat.com \
--cc=wangyanan55@huawei.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).