From: Peter Xu <peterx@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: quintela@redhat.com, marcandre.lureau@gmail.com,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
lsoaresp@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH] migration: Add canary to VMSTATE_END_OF_LIST
Date: Thu, 13 Jan 2022 20:09:37 +0800 [thread overview]
Message-ID: <YeAWbetskblijhzo@xz-m1.local> (raw)
In-Reply-To: <CAFEAcA_weTMMNsFXc5HOQLG39y-F3XBrpcez7Ln9-ckChfO-qA@mail.gmail.com>
On Thu, Jan 13, 2022 at 11:00:20AM +0000, Peter Maydell wrote:
> On Thu, 13 Jan 2022 at 01:21, Peter Xu <peterx@redhat.com> wrote:
> >
> > On Wed, Jan 12, 2022 at 10:56:07AM +0000, Peter Maydell wrote:
> > > We could have vmstate_register_with_alias_id() iterate through
> > > and assert presence of the right terminator (probably only if
> > > qtest enabled, or some other suitable condition). Then the
> > > existing tests that do the basic "check we can instantiate every
> > > device and initialize every board model" would run that code
> > > and catch most missing terminator cases, I think.
> >
> > Agreed. How about assert it even without qtest? We do tons of assertion for
> > programming errors anyway in QEMU.
>
> I don't inherently object, but in this case to do the assertion
> we'd need to do a scan over the fields arrays which we wouldn't
> otherwise need to, so the cost of the assert is not simply
> the compare-and-branch but also the loop over the array. If
> that's not significant in terms of start-up time costs we can
> just go ahead and do it (which would be nicer for debugging
> and making it really obvious to people writing new devices)
> but my remark above was a gesture towards "maybe we need to
> not do it for normal startup"..
Hmm.. Then how about put it into a "#ifdef CONFIG_DEBUG"?
We may need some extra lines in configure, though:
if test "$debug" = "yes"; then
echo "CONFIG_DEBUG=y" >> $config_host_mak
fi
PS: I'm a bit surprised we don't have CONFIG_DEBUG already..
Thanks,
--
Peter Xu
prev parent reply other threads:[~2022-01-13 12:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 10:23 [PATCH] migration: Add canary to VMSTATE_END_OF_LIST Dr. David Alan Gilbert (git)
2022-01-12 10:26 ` Peter Maydell
2022-01-12 10:42 ` Dr. David Alan Gilbert
2022-01-12 10:56 ` Peter Maydell
2022-01-13 1:21 ` Peter Xu
2022-01-13 11:00 ` Peter Maydell
2022-01-13 12:09 ` Peter Xu [this message]
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=YeAWbetskblijhzo@xz-m1.local \
--to=peterx@redhat.com \
--cc=dgilbert@redhat.com \
--cc=lsoaresp@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=peter.maydell@linaro.org \
--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).