On Thu, Feb 03, 2022 at 05:48:31PM +0000, Dr. David Alan Gilbert wrote:
> * Peter Xu ([email protected]) wrote:
> > Static variable is very unfriendly to threading of ram_block_from_stream().
> > Move it into MigrationIncomingState.
> >
> > Make the incoming state pointer to be passed over to
> > ram_block_from_stream() on
> > both caller sites.
> >
> > Signed-off-by: Peter Xu <[email protected]>
>
> OK, but I'm not sure if I noticed where you changed this to be per
> channel later?
It's done in the last patch where it'll start to pass over "channel" index into
ram_block_from_stream():
static inline RAMBlock *ram_block_from_stream(MigrationIncomingState *mis,
QEMUFile *f, int flags,
int channel)
{
RAMBlock *block = mis->last_recv_block[channel];
...
}
I could have moved it into the new PostcopyTmpPage structure, but it'll be a
bit weird because precopy also uses this to cache the block info, hence I made
it an array.
>
> Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Thanks,
--
Peter Xu