On Mon, Mar 18, 2024 at 05:08:13PM +0100, Cédric Le Goater wrote:
> > > --- a/migration/ram.c
> > > +++ b/migration/ram.c
> > > @@ -2836,18 +2836,31 @@ static void
> > > migration_bitmap_clear_discarded_pages(RAMState *rs)
> > > static void ram_init_bitmaps(RAMState *rs)
> > > {
> > > + Error *local_err = NULL;
> > > + bool ret = true;
> > > +
> > > qemu_mutex_lock_ramlist();
> > > WITH_RCU_READ_LOCK_GUARD() {
> > > ram_list_init_bitmaps();
>
> btw, should we use bitmap_try_new() to create the bitmaps instead of
> bitmap_new() which can abort() ?
I'm not sure how much it'll help in reality; if allocation can fail here I
would expect qemu crash sooner or later.. but I agree the try_new() seems
reasonable too to be used here if this can fail now, after all migration is
extra feature on top of VM's emulation functions, so it's optional.
Thanks,
--
Peter Xu