Re: [PATCH] migration: Add canary to VMSTATE_END_OF_LIST

2022-01-13 Thread Peter Xu
On Thu, Jan 13, 2022 at 11:00:20AM +, Peter Maydell wrote: > On Thu, 13 Jan 2022 at 01:21, Peter Xu wrote: > > > > On Wed, Jan 12, 2022 at 10:56:07AM +, Peter Maydell wrote: > > > We could have vmstate_register_with_alias_id() iterate through > > > and assert presence of the right terminat

Re: [PATCH] migration: Add canary to VMSTATE_END_OF_LIST

2022-01-13 Thread Peter Maydell
On Thu, 13 Jan 2022 at 01:21, Peter Xu wrote: > > On Wed, Jan 12, 2022 at 10:56:07AM +, 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)

Re: [PATCH] migration: Add canary to VMSTATE_END_OF_LIST

2022-01-12 Thread Peter Xu
On Wed, Jan 12, 2022 at 10:56:07AM +, 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 c

Re: [PATCH] migration: Add canary to VMSTATE_END_OF_LIST

2022-01-12 Thread Peter Maydell
On Wed, 12 Jan 2022 at 10:42, Dr. David Alan Gilbert wrote: > > * Peter Maydell (peter.mayd...@linaro.org) wrote: > > Does 'make check' definitely do the traversal for all vmstate > > structs, or do we need to add a "sanity check them all on startup" > > bit of test code ? > > Oh I doubt it does;

Re: [PATCH] migration: Add canary to VMSTATE_END_OF_LIST

2022-01-12 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > On Wed, 12 Jan 2022 at 10:24, Dr. David Alan Gilbert (git) > wrote: > > > > From: "Dr. David Alan Gilbert" > > > > We fairly regularly forget VMSTATE_END_OF_LIST markers off descriptions; > > given that the current check is only for ->name being

Re: [PATCH] migration: Add canary to VMSTATE_END_OF_LIST

2022-01-12 Thread Peter Maydell
On Wed, 12 Jan 2022 at 10:24, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > We fairly regularly forget VMSTATE_END_OF_LIST markers off descriptions; > given that the current check is only for ->name being NULL, sometimes > we get unlucky and the code apparently works

[PATCH] migration: Add canary to VMSTATE_END_OF_LIST

2022-01-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We fairly regularly forget VMSTATE_END_OF_LIST markers off descriptions; given that the current check is only for ->name being NULL, sometimes we get unlucky and the code apparently works and no one spots the error. Explicitly add a flag, VMS_END that should be set