On Tue, Oct 22, 2024 at 06:11:19PM +0200, Cédric Le Goater wrote: > On 10/22/24 18:07, Peter Xu wrote: > > Migration object can be freed before some other device codes run, while we > > do have a bunch of migration helpers exported in migration/misc.h that > > logically can be invoked at any time of QEMU, even during destruction of a > > VM. > > > > Make all these functions safe to be called, especially, not crashing after > > the migration object is freed. > > > > Add a rich comment in the header explaining how to guarantee thread safe on > > using these functions, and we choose BQL because fundamentally that's how > > it's working now. We can move to other things (e.g. RCU) whenever > > necessary in the future but it's an overkill if we have BQL anyway in > > most/all existing callers. > > > > When at it, update some comments, e.g. migrate_announce_params() is > > While ?
Will fix. I'll wait for a while, and see whether I should repost or just fix it up when queue. > > > exported from options.c now. > > > > Cc: Cédric Le Goater <c...@redhat.com> > > Cc: Avihai Horon <avih...@nvidia.com> > > Cc: Fabiano Rosas <faro...@suse.de> > > Cc: Dr. David Alan Gilbert <d...@treblig.org> > > Signed-off-by: Peter Xu <pet...@redhat.com> > > > Reviewed-by: Cédric Le Goater <c...@redhat.com> Thanks! -- Peter Xu