From: Fabiano Rosas <farosas@suse.de>
To: Peter Xu <peterx@redhat.com>, Roman Kiryanov <rkir@google.com>
Cc: qemu-devel@nongnu.org, whollins@google.com, jansene@google.com,
jpcottin@google.com
Subject: Re: [PATCH] vmstate: assert that VMStateDescription::fields is not NULL
Date: Tue, 10 Mar 2026 15:44:26 -0300 [thread overview]
Message-ID: <87zf4fzfqt.fsf@suse.de> (raw)
In-Reply-To: <abBHWwiqu59wCAOY@x1.local>
Peter Xu <peterx@redhat.com> writes:
> On Mon, Mar 09, 2026 at 10:31:16PM +0000, Roman Kiryanov wrote:
>> The vmstate_save_state_v() function does not
>> support NULL in VMStateDescription::fields
>> and will crash if one is provided.
>>
>> Signed-off-by: Roman Kiryanov <rkir@google.com>
>
> Thanks for the patch.
>
> Yeah I think assert it is fine, but maybe unnecessary, because we have a
> lot of such in QEMU (and IIUC in most userspace apps, likely even kernel is
> the same..) where we assert by directly reference it as a pointer..
>
> Here, the assert() only helps to crash slightly earlier, rather than the
> field->name reference later.. While in both cases it'll be crystal clear
> on what has happened when a QEMU coredump is generated, either at assert(),
> or a few instructions later.
>
> PS: please always copy Fabiano when sending migration patches.
>
I'd rather have a (vmsd->fields || vmsd->unmigratable) check when
registering.
next prev parent reply other threads:[~2026-03-10 18:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 22:31 [PATCH] vmstate: assert that VMStateDescription::fields is not NULL Roman Kiryanov
2026-03-10 16:31 ` Peter Xu
2026-03-10 18:44 ` Fabiano Rosas [this message]
2026-03-12 20:42 ` Roman Kiryanov
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=87zf4fzfqt.fsf@suse.de \
--to=farosas@suse.de \
--cc=jansene@google.com \
--cc=jpcottin@google.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkir@google.com \
--cc=whollins@google.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 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.