[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] migration: fix small leaks
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH] migration: fix small leaks |
Date: |
Wed, 3 Jan 2018 10:33:22 +0800 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Tue, Jan 02, 2018 at 03:19:38PM +0000, Dr. David Alan Gilbert wrote:
> * Vladimir Sementsov-Ogievskiy (address@hidden) wrote:
> > 28.12.2017 05:19, Peter Xu wrote:
> > > On Wed, Dec 27, 2017 at 03:25:23PM +0300, Vladimir Sementsov-Ogievskiy
> > > wrote:
> > > > Hi all!
> > > >
> > > > Hmm, looks like leak is not fixed here: I've checked it while running
> > > > iotest
> > > > 181, that
> > > > migration_instance_finalize is not called.
> > > >
> > > > If I understand correct, to call it we need unref current_migration
> > > > object
> > > > somewhere.
> > > >
> > > > Or, may be I'm missing something..
> > > I think you are right.
> > >
> > > It does not matter much though since we don't dynamically allocate
> > > migration object (there is only one and it lives forever). Do you
> > > want to post a patch? I guess the safest place to unref it is at the
> > > end of main() to make sure no one will be using it any more.
> > >
> > > (Hmm, the incoming migration state is still static)
> > >
> > > Thanks,
> >
> > Ok, I'll send a patch.
>
> Be very very careful that it doesn't crash in cases like quit in the main
> thread
> while a migration is still running.
Agree.
>
> I have no problem with this object living forever and letting it just
> die with exit().
Yes. But if better, I am thinking whether we should always make sure
migration is completed/failed/cancelled before that point. If we quit
QEMU with a working migration stream, logically we should stop it
before leaving, as part of QEMU's cleanup path.
--
Peter Xu