In my example in https://gitlab.com/qemu-project/qemu/-/issues/2522 the .needed function returns true for vmstate_tlbemb, but not for vmstate_tlb6xx. I tried to do some tests without fixing the typo. When I changed the .fields in the two structures to the same value so that the size of the data they stored matched, everything worked. I also changed the order of vmstate_tlb6xx and vmstate_tlbemb in the subsections field of vmstate_ppc_cpu, everything worked as well. According to https://www.qemu.org/docs/master/devel/migration/main.html#:~:text=On%20the%20receiving%20side%2C%20if,that%20didn%E2%80%99t%20send%20the%20subsection and on my own tests I think the problem is that when reading saved data, qemu uses the device name to determine an object that extracts a certain size of data. Since the names are the same for vmstate_tlb6xx and vmstate_tlbemb, it uses the functions for the first one due to a certain order, which leads to an error, since the data from the second one was saved.
On Wed, 21 Aug 2024 at 18:45, Peter Maydell <peter.mayd...@linaro.org> wrote: > On Wed, 21 Aug 2024 at 15:08, Physics Набиев <nabiev.arma...@gmail.com> > wrote: > > > > Sorry for not providing enough argumentation for my patch. I found a > configuration where this error occurs. Please take a look at > https://gitlab.com/qemu-project/qemu/-/issues/2522. > > Hmm. I don't understand why fixing this field name would > fix record-and-replay, because I would have thought that > all that should matter is that the name that we write out > in the record matches the one we read in in the replay... > > -- PMM >