From: Fabiano Rosas <farosas@suse.de>
To: Peter Xu <peterx@redhat.com>, qemu-devel@nongnu.org
Cc: "Juraj Marcin" <jmarcin@redhat.com>,
"Alexander Mikhalitsyn" <alexander@mihalicyn.com>,
"Peter Xu" <peterx@redhat.com>,
"Alexander Mikhalitsyn" <aleksandr.mikhalitsyn@futurfusion.io>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH 01/11] vmstate: Pass in struct itself for VMSTATE_ARRAY_OF_POINTER
Date: Mon, 20 Apr 2026 16:25:43 -0300 [thread overview]
Message-ID: <871pg9fn7s.fsf@suse.de> (raw)
In-Reply-To: <20260401202844.673494-2-peterx@redhat.com>
Peter Xu <peterx@redhat.com> writes:
> Passing in a pointer almost never helps. Convert it to pass in struct for
> further refactoring on VMS_ARRAY_OF_POINTER.
>
> Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
> Reviewed-by: Fabiano Rosas <farosas@suse.de>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> include/migration/vmstate.h | 6 +++---
> tests/unit/test-vmstate.c | 2 +-
> roms/seabios-hppa | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
> index d4a39aa794..d4880e75c2 100644
> --- a/include/migration/vmstate.h
> +++ b/include/migration/vmstate.h
> @@ -547,9 +547,9 @@ extern const VMStateInfo vmstate_info_qlist;
> .version_id = (_version), \
> .num = (_num), \
> .info = &(_info), \
> - .size = sizeof(_type), \
> + .size = sizeof(_type *), \
> .flags = VMS_ARRAY|VMS_ARRAY_OF_POINTER, \
> - .offset = vmstate_offset_array(_state, _field, _type, _num), \
> + .offset = vmstate_offset_array(_state, _field, _type *, _num), \
> }
>
> #define VMSTATE_ARRAY_OF_POINTER_TO_STRUCT(_f, _s, _n, _v, _vmsd, _type) { \
> @@ -1093,7 +1093,7 @@ extern const VMStateInfo vmstate_info_qlist;
> VMSTATE_TIMER_PTR_V(_f, _s, 0)
>
> #define VMSTATE_TIMER_PTR_ARRAY(_f, _s, _n) \
> - VMSTATE_ARRAY_OF_POINTER(_f, _s, _n, 0, vmstate_info_timer, QEMUTimer *)
> + VMSTATE_ARRAY_OF_POINTER(_f, _s, _n, 0, vmstate_info_timer, QEMUTimer)
>
> #define VMSTATE_TIMER_TEST(_f, _s, _test) \
> VMSTATE_SINGLE_TEST(_f, _s, _test, 0, vmstate_info_timer, QEMUTimer)
> diff --git a/tests/unit/test-vmstate.c b/tests/unit/test-vmstate.c
> index cadbab3c5e..6a42cc1a4e 100644
> --- a/tests/unit/test-vmstate.c
> +++ b/tests/unit/test-vmstate.c
> @@ -668,7 +668,7 @@ const VMStateDescription vmsd_arpp = {
> .minimum_version_id = 1,
> .fields = (const VMStateField[]) {
> VMSTATE_ARRAY_OF_POINTER(ar, TestArrayOfPtrToInt,
> - AR_SIZE, 0, vmstate_info_int32, int32_t*),
> + AR_SIZE, 0, vmstate_info_int32, int32_t),
> VMSTATE_END_OF_LIST()
> }
> };
> diff --git a/roms/seabios-hppa b/roms/seabios-hppa
> index cf3a472f4d..1a8ada1fb7 160000
> --- a/roms/seabios-hppa
> +++ b/roms/seabios-hppa
> @@ -1 +1 @@
> -Subproject commit cf3a472f4ddea30d2d483a8ba4b005505f0dabb3
> +Subproject commit 1a8ada1fb70643172e251aacbac673c9ecda99e9
May I delete this hunk?
next prev parent reply other threads:[~2026-04-20 19:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 20:28 [PATCH 00/11] vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOC Peter Xu
2026-04-01 20:28 ` [PATCH 01/11] vmstate: Pass in struct itself for VMSTATE_ARRAY_OF_POINTER Peter Xu
2026-04-20 19:25 ` Fabiano Rosas [this message]
2026-04-20 19:50 ` Peter Xu
2026-04-01 20:28 ` [PATCH 02/11] vmstate: Pass in struct itself for VMSTATE_VARRAY_OF_POINTER_UINT32 Peter Xu
2026-04-01 20:28 ` [PATCH 03/11] vmstate: Do not set size for VMS_ARRAY_OF_POINTER Peter Xu
2026-04-01 20:28 ` [PATCH 04/11] vmstate: Update max_elems early and check field compressable once Peter Xu
2026-04-01 20:28 ` [PATCH 05/11] vmstate: Rename VMS_NULLPTR_MARKER to VMS_MARKER_PTR_NULL Peter Xu
2026-04-01 20:28 ` [PATCH 06/11] vmstate: Introduce vmstate_save_field_with_vmdesc() Peter Xu
2026-04-01 20:28 ` [PATCH 07/11] vmstate: Allow vmstate_info_nullptr to emit non-NULL markers Peter Xu
2026-04-01 20:28 ` [PATCH 08/11] vmstate: Implement load of ptr marker in vmstate core Peter Xu
2026-04-01 20:28 ` [PATCH 09/11] vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOC Peter Xu
2026-04-01 20:28 ` [PATCH 10/11] vmstate: Stop checking size for nullptr compression Peter Xu
2026-04-01 20:28 ` [PATCH 11/11] tests/unit/test-vmstate: add tests for VMS_ARRAY_OF_POINTER_AUTO_ALLOC Peter Xu
2026-04-08 17:41 ` [PATCH 00/11] vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOC Juraj Marcin
2026-04-14 9:31 ` Alexander Mikhalitsyn
2026-04-14 15:23 ` Fabiano Rosas
2026-04-14 15:28 ` Alexander Mikhalitsyn
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=871pg9fn7s.fsf@suse.de \
--to=farosas@suse.de \
--cc=aleksandr.mikhalitsyn@futurfusion.io \
--cc=alexander@mihalicyn.com \
--cc=jmarcin@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@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.