qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] migration: Cleanup during exit


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] [PATCH] migration: Cleanup during exit
Date: Thu, 28 Feb 2019 11:40:19 +0000
User-agent: Mutt/1.11.3 (2019-02-01)

* Peter Xu (address@hidden) wrote:
> On Wed, Feb 27, 2019 at 04:49:00PM +0000, Dr. David Alan Gilbert (git) wrote:
> > From: "Dr. David Alan Gilbert" <address@hidden>
> > 
> > Currently we cleanup the migration object as we exit main after the
> > main_loop finishes; however if there's a migration running things
> > get messy and we can end up with the migration thread still trying
> > to access freed structures.
> > 
> > We now take a ref to the object around the migration thread itself,
> > so the act of dropping the ref during exit doesn't cause us to lose
> > the state until the thread quits.
> > 
> > Cancelling the migration during migration also tries to get the thread
> > to quit.
> > 
> > We do this a bit earlier; so hopefully migration gets out of the way
> > before all the devices etc are freed.
> 
> So does it mean that even with the patch it's still possible the
> migration thread will be accessing device structs that have already
> been freed which can still crash QEMU?

Possibly yes; I'm not sure how to go to the next stage and stop that
case; the consensus seems to be we don't want to explicitly block
during the exit process, so doing a join on the migration thread doesn't
seem to be wanted.

Dave

> Thanks,
> 
> -- 
> Peter Xu
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

[Prev in Thread] Current Thread [Next in Thread]