[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] A glib warning encountered with internal iothread
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] A glib warning encountered with internal iothread |
Date: |
Thu, 28 Sep 2017 10:43:27 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Wed, Sep 27, 2017 at 03:14:40PM +0200, Paolo Bonzini wrote:
> On 27/09/2017 14:36, Fam Zheng wrote:
> > On Wed, 09/27 13:17, Stefan Hajnoczi wrote:
> >> On Tue, Sep 26, 2017 at 07:13:43PM +0800, Fam Zheng wrote:
> >>> On Tue, 09/26 17:11, Peter Xu wrote:
> >>> void aio_context_unref(AioContext *ctx)
> >>> {
> >>> + assert(ctx->refcnt > 0);
> >>> + if (--ctx->refcnt == 0) {
> >>> + aio_set_event_notifier(ctx, &ctx->notifier, false, NULL, NULL);
> >>> + }
> >>
> >> This isn't a general solution because Linux AIO also has a file
> >> descriptor that is removed in aio_ctx_finalize().
> >
> > Right. Another option is to move everything in aio_context_finalize() into
> > the
> > "if (--ctx->refcnt == 0) { ... }" block, before calling g_source_unref().
>
> I think I prefer Stefan's solution. If the GSource has been ref'ed
> independent of the AioContext object, it may be a problem to free it early.
Stefan's patch works for me. I'll put Stefan's patch into iothread
series and repost soon.
Thanks Stefan (and all)!
--
Peter Xu
- [Qemu-devel] A glib warning encountered with internal iothread, Peter Xu, 2017/09/26
- Re: [Qemu-devel] A glib warning encountered with internal iothread, Stefan Hajnoczi, 2017/09/26
- Re: [Qemu-devel] A glib warning encountered with internal iothread, Peter Xu, 2017/09/26
- Re: [Qemu-devel] A glib warning encountered with internal iothread, Fam Zheng, 2017/09/26
- Re: [Qemu-devel] A glib warning encountered with internal iothread, Peter Xu, 2017/09/27
- Re: [Qemu-devel] A glib warning encountered with internal iothread, Stefan Hajnoczi, 2017/09/27
- Re: [Qemu-devel] A glib warning encountered with internal iothread, Fam Zheng, 2017/09/27
- Re: [Qemu-devel] A glib warning encountered with internal iothread, Paolo Bonzini, 2017/09/27
- Re: [Qemu-devel] A glib warning encountered with internal iothread,
Peter Xu <=