On Wed, 21 Aug 2024 at 19:56, Arman Nabiev <nabiev.arma...@gmail.com> wrote:
>
> 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.

Aha, yes, that would explain it -- the PPC CPU has both
subsections in its subsection list, but they have the
same name, so we pick the wrong one when we see the
name in the incoming data.

In that case we can take this fix without worrying
about a migration compat break, because clearly
migration has never worked for this CPU type...

-- PMM

Reply via email to