On Wed, Oct 05, 2022 at 07:51:34PM +0100, Dr. David Alan Gilbert wrote:
> >  /* struct contains XBZRLE cache and a static page
> >     used by the compression */
> >  static struct {
> > @@ -319,6 +359,11 @@ typedef struct {
> >  struct RAMState {
> >      /* QEMUFile used for this migration */
> >      QEMUFile *f;
> > +    /*
> > +     * PageSearchStatus structures for the channels when send pages.
> > +     * Protected by the bitmap_mutex.
> > +     */
> > +    PageSearchStatus pss[RAM_CHANNEL_MAX];
> 
> Why statically size this rather than allocate it in ram_state_init ?

I don't strongly feel like it needs the complexity? As there're only at
most 2 channels anyway, so the best chance is we save ~56 bytes on src qemu
but only during migration (RAMState allocated only in ram setup).

If you think we should still do the dynamic allcation, definitely doable on
my side too.

-- 
Peter Xu


Reply via email to