From: David Hildenbrand <david@redhat.com>
To: qemu-devel@nongnu.org
Cc: David Hildenbrand <david@redhat.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Michal Privoznik <mprivozn@redhat.com>
Subject: [PATCH v3 4/8] migration/vmstate: Introduce VMSTATE_WITH_TMP_TEST() and VMSTATE_BITMAP_TEST()
Date: Thu, 12 Jan 2023 17:43:59 +0100 [thread overview]
Message-ID: <20230112164403.105085-5-david@redhat.com> (raw)
In-Reply-To: <20230112164403.105085-1-david@redhat.com>
We'll make use of both next in the context of virtio-mem.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
include/migration/vmstate.h | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index dd06c3abad..e4cd21397d 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -710,8 +710,9 @@ extern const VMStateInfo vmstate_info_qlist;
* '_state' type
* That the pointer is right at the start of _tmp_type.
*/
-#define VMSTATE_WITH_TMP(_state, _tmp_type, _vmsd) { \
+#define VMSTATE_WITH_TMP_TEST(_state, _test, _tmp_type, _vmsd) { \
.name = "tmp", \
+ .field_exists = (_test), \
.size = sizeof(_tmp_type) + \
QEMU_BUILD_BUG_ON_ZERO(offsetof(_tmp_type, parent) != 0) + \
type_check_pointer(_state, \
@@ -720,6 +721,9 @@ extern const VMStateInfo vmstate_info_qlist;
.info = &vmstate_info_tmp, \
}
+#define VMSTATE_WITH_TMP(_state, _tmp_type, _vmsd) \
+ VMSTATE_WITH_TMP_TEST(_state, NULL, _tmp_type, _vmsd)
+
#define VMSTATE_UNUSED_BUFFER(_test, _version, _size) { \
.name = "unused", \
.field_exists = (_test), \
@@ -743,8 +747,9 @@ extern const VMStateInfo vmstate_info_qlist;
/* _field_size should be a int32_t field in the _state struct giving the
* size of the bitmap _field in bits.
*/
-#define VMSTATE_BITMAP(_field, _state, _version, _field_size) { \
+#define VMSTATE_BITMAP_TEST(_field, _state, _test, _version, _field_size) { \
.name = (stringify(_field)), \
+ .field_exists = (_test), \
.version_id = (_version), \
.size_offset = vmstate_offset_value(_state, _field_size, int32_t),\
.info = &vmstate_info_bitmap, \
@@ -752,6 +757,9 @@ extern const VMStateInfo vmstate_info_qlist;
.offset = offsetof(_state, _field), \
}
+#define VMSTATE_BITMAP(_field, _state, _version, _field_size) \
+ VMSTATE_BITMAP_TEST(_field, _state, NULL, _version, _field_size)
+
/* For migrating a QTAILQ.
* Target QTAILQ needs be properly initialized.
* _type: type of QTAILQ element
--
2.39.0
next prev parent reply other threads:[~2023-01-12 16:50 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 16:43 [PATCH v3 0/8] virtio-mem: Handle preallocation with migration David Hildenbrand
2023-01-12 16:43 ` [PATCH v3 1/8] migration/savevm: Move more savevm handling into vmstate_save() David Hildenbrand
2023-01-12 16:58 ` Dr. David Alan Gilbert
2023-01-12 17:49 ` David Hildenbrand
2023-01-12 18:36 ` Dr. David Alan Gilbert
2023-01-13 12:59 ` David Hildenbrand
2023-01-12 16:43 ` [PATCH v3 2/8] migration/savevm: Prepare vmdesc json writer in qemu_savevm_state_setup() David Hildenbrand
2023-01-12 17:43 ` Dr. David Alan Gilbert
2023-01-12 17:47 ` David Hildenbrand
2023-01-12 18:40 ` Dr. David Alan Gilbert
2023-01-12 22:06 ` Peter Xu
2023-01-13 13:01 ` David Hildenbrand
2023-01-13 13:05 ` David Hildenbrand
2023-01-12 16:43 ` [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM) David Hildenbrand
2023-01-12 17:56 ` Dr. David Alan Gilbert
2023-01-12 18:21 ` David Hildenbrand
2023-01-12 19:52 ` Dr. David Alan Gilbert
2023-01-12 22:14 ` Peter Xu
2023-01-12 22:28 ` Peter Xu
2023-01-13 13:47 ` David Hildenbrand
2023-01-13 15:20 ` Peter Xu
2023-01-13 15:27 ` Peter Xu
2023-01-16 10:35 ` David Hildenbrand
2023-01-16 14:56 ` Peter Xu
2023-01-16 14:57 ` David Hildenbrand
2023-01-13 15:28 ` David Hildenbrand
2023-01-12 16:43 ` David Hildenbrand [this message]
2023-01-12 16:44 ` [PATCH v3 5/8] migration/ram: Factor out check for advised postcopy David Hildenbrand
2023-01-12 18:23 ` Dr. David Alan Gilbert
2023-01-12 16:44 ` [PATCH v3 6/8] virtio-mem: Fail if a memory backend with "prealloc=on" is specified David Hildenbrand
2023-01-12 18:33 ` Dr. David Alan Gilbert
2023-01-12 16:44 ` [PATCH v3 7/8] virtio-mem: Migrate immutable properties early David Hildenbrand
2023-01-12 19:44 ` Dr. David Alan Gilbert
2023-01-13 13:59 ` David Hildenbrand
2023-01-12 16:44 ` [PATCH v3 8/8] virtio-mem: Proper support for preallocation with migration David Hildenbrand
2023-01-12 19:50 ` Dr. David Alan Gilbert
2023-01-12 16:45 ` [PATCH v3 0/8] virtio-mem: Handle " David Hildenbrand
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=20230112164403.105085-5-david@redhat.com \
--to=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=mprivozn@redhat.com \
--cc=mst@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.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 NNTP newsgroup(s).