Re: [Qemu-devel] A glib warning encountered with internal iothread

2017-09-27 Thread Peter Xu
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

Re: [Qemu-devel] A glib warning encountered with internal iothread

2017-09-27 Thread Paolo Bonzini
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

Re: [Qemu-devel] A glib warning encountered with internal iothread

2017-09-27 Thread Fam Zheng
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_notif

Re: [Qemu-devel] A glib warning encountered with internal iothread

2017-09-27 Thread Stefan Hajnoczi
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); > +} Thi

Re: [Qemu-devel] A glib warning encountered with internal iothread

2017-09-26 Thread Peter Xu
On Tue, Sep 26, 2017 at 07:13:43PM +0800, Fam Zheng wrote: > On Tue, 09/26 17:11, Peter Xu wrote: > > If glib unset the flag after calling the destructor, it'll be fine. > > But it's not doing it that way. And with above implementation of > > glib, I don't see a good way to solve this problem via

Re: [Qemu-devel] A glib warning encountered with internal iothread

2017-09-26 Thread Fam Zheng
On Tue, 09/26 17:11, Peter Xu wrote: > If glib unset the flag after calling the destructor, it'll be fine. > But it's not doing it that way. And with above implementation of > glib, I don't see a good way to solve this problem via ordering of > glib calls... :( Does this work? --- diff --git a/

Re: [Qemu-devel] A glib warning encountered with internal iothread

2017-09-26 Thread Peter Xu
On Tue, Sep 26, 2017 at 09:43:37AM +0100, Stefan Hajnoczi wrote: > On Tue, Sep 26, 2017 at 01:44:39PM +0800, Peter Xu wrote: > > Hi, > > > > Generally speaking this is a question about glib, but I would like to > > see how the list sees this before throwing this question to glib > > community in c

Re: [Qemu-devel] A glib warning encountered with internal iothread

2017-09-26 Thread Stefan Hajnoczi
On Tue, Sep 26, 2017 at 01:44:39PM +0800, Peter Xu wrote: > Hi, > > Generally speaking this is a question about glib, but I would like to > see how the list sees this before throwing this question to glib > community in case I made severe mistake. > > I encountered one glib warning when start to

[Qemu-devel] A glib warning encountered with internal iothread

2017-09-25 Thread Peter Xu
Hi, Generally speaking this is a question about glib, but I would like to see how the list sees this before throwing this question to glib community in case I made severe mistake. I encountered one glib warning when start to use internal iothread: (qemu-system-x86_64:19925): GLib-CRITICAL **: g_