From: Peter Xu <peterx@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Fabiano Rosas <farosas@suse.de>,
qemu-devel@nongnu.org,
Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Subject: Re: [PATCH 2/4] migration: Introduce VMStateOffset
Date: Thu, 30 Jul 2026 11:23:16 -0400 [thread overview]
Message-ID: <amtsZDQHTLg3nvdB@x1.local> (raw)
In-Reply-To: <20260730101353-mutt-send-email-mst@kernel.org>
On Thu, Jul 30, 2026 at 10:35:41AM -0400, Michael S. Tsirkin wrote:
> > diff --git a/migration/savevm.c b/migration/savevm.c
> > index 34dd06f9f73..a272bcfd0b4 100644
> > --- a/migration/savevm.c
> > +++ b/migration/savevm.c
> > @@ -873,14 +873,14 @@ static void vmstate_check(const VMStateDescription *vmsd)
> > * Size must be provided because dest QEMU needs that
> > * info to know what to allocate
> > */
> > - assert(field->size || field->size_offset);
> > + assert(field->size || field->size_offset.size != 0);
>
> Why is field->size checked by coersing it to bool, but
> field->size_offset.size - by comparison to 0?
> field->size != 0 for consistency?
Indeed it might be better to add a comment, but for another reason: IIUC
old code was wrong.. size_offset can be 0 if the size field is the 1st
element.. so this may have fixed a bug.
--
Peter Xu
next prev parent reply other threads:[~2026-07-30 15:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 22:52 [PATCH 0/4] migration: Remove extra type-checking from vmstate macros Fabiano Rosas
2026-07-29 22:52 ` [PATCH 1/4] migration: Remove VMSTATE_ARRAY_INT32_UNSAFE Fabiano Rosas
2026-07-30 8:07 ` Vladimir Sementsov-Ogievskiy
2026-07-29 22:52 ` [PATCH 2/4] migration: Introduce VMStateOffset Fabiano Rosas
2026-07-30 8:06 ` Vladimir Sementsov-Ogievskiy
2026-07-30 14:45 ` Fabiano Rosas
2026-07-30 14:35 ` Michael S. Tsirkin
2026-07-30 15:15 ` Fabiano Rosas
2026-07-30 15:23 ` Peter Xu [this message]
2026-07-29 22:52 ` [PATCH 3/4] migration: Remove redundant flags Fabiano Rosas
2026-07-30 8:11 ` Vladimir Sementsov-Ogievskiy
2026-07-30 8:23 ` Vladimir Sementsov-Ogievskiy
2026-07-29 22:52 ` [PATCH 4/4] migration: Remove duplicate vmstate macros Fabiano Rosas
2026-07-30 8:19 ` Vladimir Sementsov-Ogievskiy
2026-07-30 8:22 ` [PATCH 0/4] migration: Remove extra type-checking from " Vladimir Sementsov-Ogievskiy
2026-07-30 14:09 ` Peter Xu
2026-07-30 14:22 ` Peter Xu
2026-07-30 14:45 ` Michael S. Tsirkin
2026-07-30 15:50 ` Fabiano Rosas
2026-07-30 16:31 ` Peter Xu
2026-07-30 15:37 ` Fabiano Rosas
2026-07-30 16:16 ` 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=amtsZDQHTLg3nvdB@x1.local \
--to=peterx@redhat.com \
--cc=dtalexundeer@yandex-team.ru \
--cc=farosas@suse.de \
--cc=mst@redhat.com \
--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.