[{"id":1773382,"web_url":"http://patchwork.ozlabs.org/comment/1773382/","msgid":"<20170922090433.GC12725@redhat.com>","list_archive_url":null,"date":"2017-09-22T09:04:33","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n> IOThread is a general framework that contains IO loop environment and a\n> real thread behind.  It's also good to be used internally inside qemu.\n> Provide some helpers for it to create iothreads to be used internally.\n> \n> Signed-off-by: Peter Xu <peterx@redhat.com>\n> ---\n>  include/sysemu/iothread.h |  8 ++++++++\n>  iothread.c                | 21 +++++++++++++++++++++\n>  2 files changed, 29 insertions(+)\n> \n> diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n> index d2985b3..b07663f 100644\n> --- a/include/sysemu/iothread.h\n> +++ b/include/sysemu/iothread.h\n> @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n>  void iothread_stop_all(void);\n>  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n>  \n> +/*\n> + * Helpers used to allocate iothreads for internal use.  These\n> + * iothreads will not be seen by monitor clients when query using\n> + * \"query-iothreads\".\n> + */\n> +IOThread *iothread_create(const char *id, Error **errp);\n> +void iothread_destroy(IOThread *iothread);\n> +\n>  #endif /* IOTHREAD_H */\n> diff --git a/iothread.c b/iothread.c\n> index 44c8944..74e400c 100644\n> --- a/iothread.c\n> +++ b/iothread.c\n> @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n>  \n>      return iothread->worker_context;\n>  }\n> +\n> +static Object *iothread_get_internal_parent(void)\n> +{\n> +    return container_get(object_get_root(), \"/internal-iothreads\");\n> +}\n\nI tend to think we might benefit from having this generalized in the\nQOM API instead. We have object_get_objects_root() for things that\nare created by the mgmt app / user via CLI / QMP.  A parallel method\nobject_get_internal_root() could be useful for cases like this where\nwe want to create user-creatable objects, but not have them be\nvisible to the mgmt app / user, as that would confuse the mgmt app.\n\nExample for this scenario - libvirt calls query-iothreads to identify\nIO thread PIDs, and would get very unhappy if the IOThread used by\nthe monitor would appear in that response, which is why Peter has\nput it under /internal-iothreads. I think this scenario will apply\nmore broadly, so benefit from us having a general helper in QOM.\n\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz6yD1sDnz9sPm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 19:05:19 +1000 (AEST)","from localhost ([::1]:57447 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvJtb-0007ZX-PT\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 05:05:15 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:57864)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvJtB-0007ZO-Jv\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:04:50 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvJt7-0002NZ-KX\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:04:49 -0400","from mx1.redhat.com ([209.132.183.28]:48302)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dvJt7-0002N0-CM\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:04:45 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 7E3B38125F\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 09:04:43 +0000 (UTC)","from redhat.com (unknown [10.33.36.109])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id E90D45C542;\n\tFri, 22 Sep 2017 09:04:36 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 7E3B38125F","Date":"Fri, 22 Sep 2017 10:04:33 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Peter Xu <peterx@redhat.com>","Message-ID":"<20170922090433.GC12725@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<1506070572-7549-2-git-send-email-peterx@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tFri, 22 Sep 2017 09:04:43 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"Fam Zheng <famz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>, qemu-devel@nongnu.org,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773385,"web_url":"http://patchwork.ozlabs.org/comment/1773385/","msgid":"<20170922091430.GJ30661@pxdev.xzpeter.org>","list_archive_url":null,"date":"2017-09-22T09:14:30","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":67717,"url":"http://patchwork.ozlabs.org/api/people/67717/","name":"Peter Xu","email":"peterx@redhat.com"},"content":"On Fri, Sep 22, 2017 at 10:04:33AM +0100, Daniel P. Berrange wrote:\n> On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n> > IOThread is a general framework that contains IO loop environment and a\n> > real thread behind.  It's also good to be used internally inside qemu.\n> > Provide some helpers for it to create iothreads to be used internally.\n> > \n> > Signed-off-by: Peter Xu <peterx@redhat.com>\n> > ---\n> >  include/sysemu/iothread.h |  8 ++++++++\n> >  iothread.c                | 21 +++++++++++++++++++++\n> >  2 files changed, 29 insertions(+)\n> > \n> > diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n> > index d2985b3..b07663f 100644\n> > --- a/include/sysemu/iothread.h\n> > +++ b/include/sysemu/iothread.h\n> > @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n> >  void iothread_stop_all(void);\n> >  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n> >  \n> > +/*\n> > + * Helpers used to allocate iothreads for internal use.  These\n> > + * iothreads will not be seen by monitor clients when query using\n> > + * \"query-iothreads\".\n> > + */\n> > +IOThread *iothread_create(const char *id, Error **errp);\n> > +void iothread_destroy(IOThread *iothread);\n> > +\n> >  #endif /* IOTHREAD_H */\n> > diff --git a/iothread.c b/iothread.c\n> > index 44c8944..74e400c 100644\n> > --- a/iothread.c\n> > +++ b/iothread.c\n> > @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n> >  \n> >      return iothread->worker_context;\n> >  }\n> > +\n> > +static Object *iothread_get_internal_parent(void)\n> > +{\n> > +    return container_get(object_get_root(), \"/internal-iothreads\");\n> > +}\n> \n> I tend to think we might benefit from having this generalized in the\n> QOM API instead. We have object_get_objects_root() for things that\n> are created by the mgmt app / user via CLI / QMP.  A parallel method\n> object_get_internal_root() could be useful for cases like this where\n> we want to create user-creatable objects, but not have them be\n> visible to the mgmt app / user, as that would confuse the mgmt app.\n> \n> Example for this scenario - libvirt calls query-iothreads to identify\n> IO thread PIDs, and would get very unhappy if the IOThread used by\n> the monitor would appear in that response, which is why Peter has\n> put it under /internal-iothreads. I think this scenario will apply\n> more broadly, so benefit from us having a general helper in QOM.\n\nYeah, I can split the patch if we want it to be exposed to public.\n\nIn that case, would the name \"object_get_internal_root\" be good?\n\nThanks,","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=peterx@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz79g0L1lz9sPm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 19:15:17 +1000 (AEST)","from localhost ([::1]:57472 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvK3H-00022A-8k\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 05:15:15 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:32837)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dvK2l-00021d-7j\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:14:44 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dvK2h-0007if-8i\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:14:43 -0400","from mx1.redhat.com ([209.132.183.28]:51418)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <peterx@redhat.com>) id 1dvK2g-0007h1-WB\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:14:39 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id B52DBC047B82\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 09:14:37 +0000 (UTC)","from pxdev.xzpeter.org (ovpn-12-133.pek2.redhat.com [10.72.12.133])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 735C25D9CD;\n\tFri, 22 Sep 2017 09:14:33 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com B52DBC047B82","Date":"Fri, 22 Sep 2017 17:14:30 +0800","From":"Peter Xu <peterx@redhat.com>","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Message-ID":"<20170922091430.GJ30661@pxdev.xzpeter.org>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922090433.GC12725@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170922090433.GC12725@redhat.com>","User-Agent":"Mutt/1.5.24 (2015-08-30)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tFri, 22 Sep 2017 09:14:37 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>, qemu-devel@nongnu.org,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773391,"web_url":"http://patchwork.ozlabs.org/comment/1773391/","msgid":"<20170922093631.GG12725@redhat.com>","list_archive_url":null,"date":"2017-09-22T09:36:31","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Fri, Sep 22, 2017 at 05:14:30PM +0800, Peter Xu wrote:\n> On Fri, Sep 22, 2017 at 10:04:33AM +0100, Daniel P. Berrange wrote:\n> > On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n> > > IOThread is a general framework that contains IO loop environment and a\n> > > real thread behind.  It's also good to be used internally inside qemu.\n> > > Provide some helpers for it to create iothreads to be used internally.\n> > > \n> > > Signed-off-by: Peter Xu <peterx@redhat.com>\n> > > ---\n> > >  include/sysemu/iothread.h |  8 ++++++++\n> > >  iothread.c                | 21 +++++++++++++++++++++\n> > >  2 files changed, 29 insertions(+)\n> > > \n> > > diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n> > > index d2985b3..b07663f 100644\n> > > --- a/include/sysemu/iothread.h\n> > > +++ b/include/sysemu/iothread.h\n> > > @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n> > >  void iothread_stop_all(void);\n> > >  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n> > >  \n> > > +/*\n> > > + * Helpers used to allocate iothreads for internal use.  These\n> > > + * iothreads will not be seen by monitor clients when query using\n> > > + * \"query-iothreads\".\n> > > + */\n> > > +IOThread *iothread_create(const char *id, Error **errp);\n> > > +void iothread_destroy(IOThread *iothread);\n> > > +\n> > >  #endif /* IOTHREAD_H */\n> > > diff --git a/iothread.c b/iothread.c\n> > > index 44c8944..74e400c 100644\n> > > --- a/iothread.c\n> > > +++ b/iothread.c\n> > > @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n> > >  \n> > >      return iothread->worker_context;\n> > >  }\n> > > +\n> > > +static Object *iothread_get_internal_parent(void)\n> > > +{\n> > > +    return container_get(object_get_root(), \"/internal-iothreads\");\n> > > +}\n> > \n> > I tend to think we might benefit from having this generalized in the\n> > QOM API instead. We have object_get_objects_root() for things that\n> > are created by the mgmt app / user via CLI / QMP.  A parallel method\n> > object_get_internal_root() could be useful for cases like this where\n> > we want to create user-creatable objects, but not have them be\n> > visible to the mgmt app / user, as that would confuse the mgmt app.\n> > \n> > Example for this scenario - libvirt calls query-iothreads to identify\n> > IO thread PIDs, and would get very unhappy if the IOThread used by\n> > the monitor would appear in that response, which is why Peter has\n> > put it under /internal-iothreads. I think this scenario will apply\n> > more broadly, so benefit from us having a general helper in QOM.\n> \n> Yeah, I can split the patch if we want it to be exposed to public.\n> \n> In that case, would the name \"object_get_internal_root\" be good?\n\nYeah that's fine with me, but lets see if Paolo has any thoughts from\nthe QOM side.\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz7g82nYDz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 19:37:24 +1000 (AEST)","from localhost ([::1]:57551 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvKOg-0006bm-HB\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 05:37:22 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38865)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvKO5-0006XM-SD\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:36:47 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvKO1-0000rf-L9\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:36:45 -0400","from mx1.redhat.com ([209.132.183.28]:58926)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dvKO1-0000rI-Bo\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:36:41 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 53669C05005F\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 09:36:40 +0000 (UTC)","from redhat.com (unknown [10.33.36.109])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 343B96266F;\n\tFri, 22 Sep 2017 09:36:33 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 53669C05005F","Date":"Fri, 22 Sep 2017 10:36:31 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Peter Xu <peterx@redhat.com>","Message-ID":"<20170922093631.GG12725@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922090433.GC12725@redhat.com>\n\t<20170922091430.GJ30661@pxdev.xzpeter.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170922091430.GJ30661@pxdev.xzpeter.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tFri, 22 Sep 2017 09:36:40 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"Fam Zheng <famz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>, qemu-devel@nongnu.org,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773393,"web_url":"http://patchwork.ozlabs.org/comment/1773393/","msgid":"<4760b1a1-446d-fc2c-8794-8860bededc56@redhat.com>","list_archive_url":null,"date":"2017-09-22T09:38:31","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 22/09/2017 11:36, Daniel P. Berrange wrote:\n> On Fri, Sep 22, 2017 at 05:14:30PM +0800, Peter Xu wrote:\n>> On Fri, Sep 22, 2017 at 10:04:33AM +0100, Daniel P. Berrange wrote:\n>>> On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n>>>> IOThread is a general framework that contains IO loop environment and a\n>>>> real thread behind.  It's also good to be used internally inside qemu.\n>>>> Provide some helpers for it to create iothreads to be used internally.\n>>>>\n>>>> Signed-off-by: Peter Xu <peterx@redhat.com>\n>>>> ---\n>>>>  include/sysemu/iothread.h |  8 ++++++++\n>>>>  iothread.c                | 21 +++++++++++++++++++++\n>>>>  2 files changed, 29 insertions(+)\n>>>>\n>>>> diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n>>>> index d2985b3..b07663f 100644\n>>>> --- a/include/sysemu/iothread.h\n>>>> +++ b/include/sysemu/iothread.h\n>>>> @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n>>>>  void iothread_stop_all(void);\n>>>>  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n>>>>  \n>>>> +/*\n>>>> + * Helpers used to allocate iothreads for internal use.  These\n>>>> + * iothreads will not be seen by monitor clients when query using\n>>>> + * \"query-iothreads\".\n>>>> + */\n>>>> +IOThread *iothread_create(const char *id, Error **errp);\n>>>> +void iothread_destroy(IOThread *iothread);\n>>>> +\n>>>>  #endif /* IOTHREAD_H */\n>>>> diff --git a/iothread.c b/iothread.c\n>>>> index 44c8944..74e400c 100644\n>>>> --- a/iothread.c\n>>>> +++ b/iothread.c\n>>>> @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n>>>>  \n>>>>      return iothread->worker_context;\n>>>>  }\n>>>> +\n>>>> +static Object *iothread_get_internal_parent(void)\n>>>> +{\n>>>> +    return container_get(object_get_root(), \"/internal-iothreads\");\n>>>> +}\n>>>\n>>> I tend to think we might benefit from having this generalized in the\n>>> QOM API instead. We have object_get_objects_root() for things that\n>>> are created by the mgmt app / user via CLI / QMP.  A parallel method\n>>> object_get_internal_root() could be useful for cases like this where\n>>> we want to create user-creatable objects, but not have them be\n>>> visible to the mgmt app / user, as that would confuse the mgmt app.\n>>>\n>>> Example for this scenario - libvirt calls query-iothreads to identify\n>>> IO thread PIDs, and would get very unhappy if the IOThread used by\n>>> the monitor would appear in that response, which is why Peter has\n>>> put it under /internal-iothreads. I think this scenario will apply\n>>> more broadly, so benefit from us having a general helper in QOM.\n>>\n>> Yeah, I can split the patch if we want it to be exposed to public.\n>>\n>> In that case, would the name \"object_get_internal_root\" be good?\n> \n> Yeah that's fine with me, but lets see if Paolo has any thoughts from\n> the QOM side.\n\nNo, I don't.  However, I wonder if query-iothreads should have an\nargument to include internal iothreads.\n\nPaolo","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz7j56Ngjz9s5L\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 19:39:05 +1000 (AEST)","from localhost ([::1]:57555 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvKQK-0007xV-25\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 05:39:04 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39297)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dvKQ0-0007xK-Po\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:38:46 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dvKPv-0002nM-PN\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:38:44 -0400","from mx1.redhat.com ([209.132.183.28]:49874)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>) id 1dvKPv-0002mz-GJ\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:38:39 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 7BAA785540\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 09:38:38 +0000 (UTC)","from [10.36.117.77] (ovpn-117-77.ams2.redhat.com [10.36.117.77])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 1663260842;\n\tFri, 22 Sep 2017 09:38:32 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 7BAA785540","To":"\"Daniel P. Berrange\" <berrange@redhat.com>, Peter Xu <peterx@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922090433.GC12725@redhat.com>\n\t<20170922091430.GJ30661@pxdev.xzpeter.org>\n\t<20170922093631.GG12725@redhat.com>","From":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<4760b1a1-446d-fc2c-8794-8860bededc56@redhat.com>","Date":"Fri, 22 Sep 2017 11:38:31 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170922093631.GG12725@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tFri, 22 Sep 2017 09:38:38 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>, Stefan Hajnoczi <shajnocz@redhat.com>,\n\tqemu-devel@nongnu.org, \"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773397,"web_url":"http://patchwork.ozlabs.org/comment/1773397/","msgid":"<20170922094325.GH12725@redhat.com>","list_archive_url":null,"date":"2017-09-22T09:43:25","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Fri, Sep 22, 2017 at 11:38:31AM +0200, Paolo Bonzini wrote:\n> On 22/09/2017 11:36, Daniel P. Berrange wrote:\n> > On Fri, Sep 22, 2017 at 05:14:30PM +0800, Peter Xu wrote:\n> >> On Fri, Sep 22, 2017 at 10:04:33AM +0100, Daniel P. Berrange wrote:\n> >>> On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n> >>>> IOThread is a general framework that contains IO loop environment and a\n> >>>> real thread behind.  It's also good to be used internally inside qemu.\n> >>>> Provide some helpers for it to create iothreads to be used internally.\n> >>>>\n> >>>> Signed-off-by: Peter Xu <peterx@redhat.com>\n> >>>> ---\n> >>>>  include/sysemu/iothread.h |  8 ++++++++\n> >>>>  iothread.c                | 21 +++++++++++++++++++++\n> >>>>  2 files changed, 29 insertions(+)\n> >>>>\n> >>>> diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n> >>>> index d2985b3..b07663f 100644\n> >>>> --- a/include/sysemu/iothread.h\n> >>>> +++ b/include/sysemu/iothread.h\n> >>>> @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n> >>>>  void iothread_stop_all(void);\n> >>>>  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n> >>>>  \n> >>>> +/*\n> >>>> + * Helpers used to allocate iothreads for internal use.  These\n> >>>> + * iothreads will not be seen by monitor clients when query using\n> >>>> + * \"query-iothreads\".\n> >>>> + */\n> >>>> +IOThread *iothread_create(const char *id, Error **errp);\n> >>>> +void iothread_destroy(IOThread *iothread);\n> >>>> +\n> >>>>  #endif /* IOTHREAD_H */\n> >>>> diff --git a/iothread.c b/iothread.c\n> >>>> index 44c8944..74e400c 100644\n> >>>> --- a/iothread.c\n> >>>> +++ b/iothread.c\n> >>>> @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n> >>>>  \n> >>>>      return iothread->worker_context;\n> >>>>  }\n> >>>> +\n> >>>> +static Object *iothread_get_internal_parent(void)\n> >>>> +{\n> >>>> +    return container_get(object_get_root(), \"/internal-iothreads\");\n> >>>> +}\n> >>>\n> >>> I tend to think we might benefit from having this generalized in the\n> >>> QOM API instead. We have object_get_objects_root() for things that\n> >>> are created by the mgmt app / user via CLI / QMP.  A parallel method\n> >>> object_get_internal_root() could be useful for cases like this where\n> >>> we want to create user-creatable objects, but not have them be\n> >>> visible to the mgmt app / user, as that would confuse the mgmt app.\n> >>>\n> >>> Example for this scenario - libvirt calls query-iothreads to identify\n> >>> IO thread PIDs, and would get very unhappy if the IOThread used by\n> >>> the monitor would appear in that response, which is why Peter has\n> >>> put it under /internal-iothreads. I think this scenario will apply\n> >>> more broadly, so benefit from us having a general helper in QOM.\n> >>\n> >> Yeah, I can split the patch if we want it to be exposed to public.\n> >>\n> >> In that case, would the name \"object_get_internal_root\" be good?\n> > \n> > Yeah that's fine with me, but lets see if Paolo has any thoughts from\n> > the QOM side.\n> \n> No, I don't.  However, I wonder if query-iothreads should have an\n> argument to include internal iothreads.\n\nI guess it depends whether we consider use of iothreads for migration\nto be a private impl detail that may be ripped out & replaced at any\ntime, or a semi-public detail that apps may rely on.  Personally I\nwould suggest it should be a private impl detail of migration code\nthat is never exposed to anything outside QEMU, so we have flexibility\nto change it at will later.\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz7pp1pFqz9sP1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 19:44:02 +1000 (AEST)","from localhost ([::1]:57592 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvKV6-0002oo-Bb\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 05:44:00 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:40927)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvKUk-0002nF-NJ\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:43:40 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvKUj-0007TA-85\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:43:38 -0400","from mx1.redhat.com ([209.132.183.28]:23905)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dvKUi-0007Sb-V1\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:43:37 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id DDC7F20271\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 09:43:35 +0000 (UTC)","from redhat.com (unknown [10.33.36.109])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 488DA5D9CD;\n\tFri, 22 Sep 2017 09:43:28 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com DDC7F20271","Date":"Fri, 22 Sep 2017 10:43:25 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<20170922094325.GH12725@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922090433.GC12725@redhat.com>\n\t<20170922091430.GJ30661@pxdev.xzpeter.org>\n\t<20170922093631.GG12725@redhat.com>\n\t<4760b1a1-446d-fc2c-8794-8860bededc56@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<4760b1a1-446d-fc2c-8794-8860bededc56@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tFri, 22 Sep 2017 09:43:36 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"Fam Zheng <famz@redhat.com>, Stefan Hajnoczi <shajnocz@redhat.com>,\n\tqemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773439,"web_url":"http://patchwork.ozlabs.org/comment/1773439/","msgid":"<d0992b81-d5d0-6957-d292-52be50a21ec7@redhat.com>","list_archive_url":null,"date":"2017-09-22T10:14:04","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 22/09/2017 11:43, Daniel P. Berrange wrote:\n> On Fri, Sep 22, 2017 at 11:38:31AM +0200, Paolo Bonzini wrote:\n>> On 22/09/2017 11:36, Daniel P. Berrange wrote:\n>>> On Fri, Sep 22, 2017 at 05:14:30PM +0800, Peter Xu wrote:\n>>>> On Fri, Sep 22, 2017 at 10:04:33AM +0100, Daniel P. Berrange wrote:\n>>>>> On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n>>>>>> IOThread is a general framework that contains IO loop environment and a\n>>>>>> real thread behind.  It's also good to be used internally inside qemu.\n>>>>>> Provide some helpers for it to create iothreads to be used internally.\n>>>>>>\n>>>>>> Signed-off-by: Peter Xu <peterx@redhat.com>\n>>>>>> ---\n>>>>>>  include/sysemu/iothread.h |  8 ++++++++\n>>>>>>  iothread.c                | 21 +++++++++++++++++++++\n>>>>>>  2 files changed, 29 insertions(+)\n>>>>>>\n>>>>>> diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n>>>>>> index d2985b3..b07663f 100644\n>>>>>> --- a/include/sysemu/iothread.h\n>>>>>> +++ b/include/sysemu/iothread.h\n>>>>>> @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n>>>>>>  void iothread_stop_all(void);\n>>>>>>  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n>>>>>>  \n>>>>>> +/*\n>>>>>> + * Helpers used to allocate iothreads for internal use.  These\n>>>>>> + * iothreads will not be seen by monitor clients when query using\n>>>>>> + * \"query-iothreads\".\n>>>>>> + */\n>>>>>> +IOThread *iothread_create(const char *id, Error **errp);\n>>>>>> +void iothread_destroy(IOThread *iothread);\n>>>>>> +\n>>>>>>  #endif /* IOTHREAD_H */\n>>>>>> diff --git a/iothread.c b/iothread.c\n>>>>>> index 44c8944..74e400c 100644\n>>>>>> --- a/iothread.c\n>>>>>> +++ b/iothread.c\n>>>>>> @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n>>>>>>  \n>>>>>>      return iothread->worker_context;\n>>>>>>  }\n>>>>>> +\n>>>>>> +static Object *iothread_get_internal_parent(void)\n>>>>>> +{\n>>>>>> +    return container_get(object_get_root(), \"/internal-iothreads\");\n>>>>>> +}\n>>>>>\n>>>>> I tend to think we might benefit from having this generalized in the\n>>>>> QOM API instead. We have object_get_objects_root() for things that\n>>>>> are created by the mgmt app / user via CLI / QMP.  A parallel method\n>>>>> object_get_internal_root() could be useful for cases like this where\n>>>>> we want to create user-creatable objects, but not have them be\n>>>>> visible to the mgmt app / user, as that would confuse the mgmt app.\n>>>>>\n>>>>> Example for this scenario - libvirt calls query-iothreads to identify\n>>>>> IO thread PIDs, and would get very unhappy if the IOThread used by\n>>>>> the monitor would appear in that response, which is why Peter has\n>>>>> put it under /internal-iothreads. I think this scenario will apply\n>>>>> more broadly, so benefit from us having a general helper in QOM.\n>>>>\n>>>> Yeah, I can split the patch if we want it to be exposed to public.\n>>>>\n>>>> In that case, would the name \"object_get_internal_root\" be good?\n>>>\n>>> Yeah that's fine with me, but lets see if Paolo has any thoughts from\n>>> the QOM side.\n>>\n>> No, I don't.  However, I wonder if query-iothreads should have an\n>> argument to include internal iothreads.\n> \n> I guess it depends whether we consider use of iothreads for migration\n> to be a private impl detail that may be ripped out & replaced at any\n> time, or a semi-public detail that apps may rely on.  Personally I\n> would suggest it should be a private impl detail of migration code\n> that is never exposed to anything outside QEMU, so we have flexibility\n> to change it at will later.\n\nAs far as I understood it's not migration, it's the whole monitor that\nmoves to the iothread.  So it's a thing that lasts for the whole\nexistence of the QEMU process.  But I may be wrong.\n\nPaolo\n\nPaolo","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz8Z54QKWz9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 20:18:05 +1000 (AEST)","from localhost ([::1]:57779 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvL23-0005Jz-Nx\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 06:18:03 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:50135)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dvKyM-00030W-UR\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:14:18 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dvKyJ-0002V8-KU\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:14:14 -0400","from mx1.redhat.com ([209.132.183.28]:50632)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>) id 1dvKyJ-0002UF-Al\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:14:11 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 3EBE0267C4\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 10:14:10 +0000 (UTC)","from [10.36.117.77] (ovpn-117-77.ams2.redhat.com [10.36.117.77])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 6E0D7619E6;\n\tFri, 22 Sep 2017 10:14:06 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 3EBE0267C4","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922090433.GC12725@redhat.com>\n\t<20170922091430.GJ30661@pxdev.xzpeter.org>\n\t<20170922093631.GG12725@redhat.com>\n\t<4760b1a1-446d-fc2c-8794-8860bededc56@redhat.com>\n\t<20170922094325.GH12725@redhat.com>","From":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<d0992b81-d5d0-6957-d292-52be50a21ec7@redhat.com>","Date":"Fri, 22 Sep 2017 12:14:04 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170922094325.GH12725@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tFri, 22 Sep 2017 10:14:10 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>, Stefan Hajnoczi <shajnocz@redhat.com>,\n\tqemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773441,"web_url":"http://patchwork.ozlabs.org/comment/1773441/","msgid":"<20170922101728.GJ12725@redhat.com>","list_archive_url":null,"date":"2017-09-22T10:17:28","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Fri, Sep 22, 2017 at 12:14:04PM +0200, Paolo Bonzini wrote:\n> On 22/09/2017 11:43, Daniel P. Berrange wrote:\n> > On Fri, Sep 22, 2017 at 11:38:31AM +0200, Paolo Bonzini wrote:\n> >> On 22/09/2017 11:36, Daniel P. Berrange wrote:\n> >>> On Fri, Sep 22, 2017 at 05:14:30PM +0800, Peter Xu wrote:\n> >>>> On Fri, Sep 22, 2017 at 10:04:33AM +0100, Daniel P. Berrange wrote:\n> >>>>> On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n> >>>>>> IOThread is a general framework that contains IO loop environment and a\n> >>>>>> real thread behind.  It's also good to be used internally inside qemu.\n> >>>>>> Provide some helpers for it to create iothreads to be used internally.\n> >>>>>>\n> >>>>>> Signed-off-by: Peter Xu <peterx@redhat.com>\n> >>>>>> ---\n> >>>>>>  include/sysemu/iothread.h |  8 ++++++++\n> >>>>>>  iothread.c                | 21 +++++++++++++++++++++\n> >>>>>>  2 files changed, 29 insertions(+)\n> >>>>>>\n> >>>>>> diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n> >>>>>> index d2985b3..b07663f 100644\n> >>>>>> --- a/include/sysemu/iothread.h\n> >>>>>> +++ b/include/sysemu/iothread.h\n> >>>>>> @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n> >>>>>>  void iothread_stop_all(void);\n> >>>>>>  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n> >>>>>>  \n> >>>>>> +/*\n> >>>>>> + * Helpers used to allocate iothreads for internal use.  These\n> >>>>>> + * iothreads will not be seen by monitor clients when query using\n> >>>>>> + * \"query-iothreads\".\n> >>>>>> + */\n> >>>>>> +IOThread *iothread_create(const char *id, Error **errp);\n> >>>>>> +void iothread_destroy(IOThread *iothread);\n> >>>>>> +\n> >>>>>>  #endif /* IOTHREAD_H */\n> >>>>>> diff --git a/iothread.c b/iothread.c\n> >>>>>> index 44c8944..74e400c 100644\n> >>>>>> --- a/iothread.c\n> >>>>>> +++ b/iothread.c\n> >>>>>> @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n> >>>>>>  \n> >>>>>>      return iothread->worker_context;\n> >>>>>>  }\n> >>>>>> +\n> >>>>>> +static Object *iothread_get_internal_parent(void)\n> >>>>>> +{\n> >>>>>> +    return container_get(object_get_root(), \"/internal-iothreads\");\n> >>>>>> +}\n> >>>>>\n> >>>>> I tend to think we might benefit from having this generalized in the\n> >>>>> QOM API instead. We have object_get_objects_root() for things that\n> >>>>> are created by the mgmt app / user via CLI / QMP.  A parallel method\n> >>>>> object_get_internal_root() could be useful for cases like this where\n> >>>>> we want to create user-creatable objects, but not have them be\n> >>>>> visible to the mgmt app / user, as that would confuse the mgmt app.\n> >>>>>\n> >>>>> Example for this scenario - libvirt calls query-iothreads to identify\n> >>>>> IO thread PIDs, and would get very unhappy if the IOThread used by\n> >>>>> the monitor would appear in that response, which is why Peter has\n> >>>>> put it under /internal-iothreads. I think this scenario will apply\n> >>>>> more broadly, so benefit from us having a general helper in QOM.\n> >>>>\n> >>>> Yeah, I can split the patch if we want it to be exposed to public.\n> >>>>\n> >>>> In that case, would the name \"object_get_internal_root\" be good?\n> >>>\n> >>> Yeah that's fine with me, but lets see if Paolo has any thoughts from\n> >>> the QOM side.\n> >>\n> >> No, I don't.  However, I wonder if query-iothreads should have an\n> >> argument to include internal iothreads.\n> > \n> > I guess it depends whether we consider use of iothreads for migration\n> > to be a private impl detail that may be ripped out & replaced at any\n> > time, or a semi-public detail that apps may rely on.  Personally I\n> > would suggest it should be a private impl detail of migration code\n> > that is never exposed to anything outside QEMU, so we have flexibility\n> > to change it at will later.\n> \n> As far as I understood it's not migration, it's the whole monitor that\n> moves to the iothread.  So it's a thing that lasts for the whole\n> existence of the QEMU process.  But I may be wrong.\n\nSorry yes, my bad - its the iothread behind the monitor. I still think that\nis a detail worth keeping private in case we want to refactor how the\nmonitor threading works later.\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz8ZH0LjBz9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 20:18:15 +1000 (AEST)","from localhost ([::1]:57780 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvL2D-0005Mv-4l\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 06:18:13 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:50988)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvL1i-0005LO-7S\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:17:43 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvL1e-0004xP-TP\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:17:42 -0400","from mx1.redhat.com ([209.132.183.28]:40586)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dvL1e-0004wi-KU\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:17:38 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id BDA67806D1\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 10:17:37 +0000 (UTC)","from redhat.com (unknown [10.33.36.109])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 15EF4600CD;\n\tFri, 22 Sep 2017 10:17:30 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com BDA67806D1","Date":"Fri, 22 Sep 2017 11:17:28 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<20170922101728.GJ12725@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922090433.GC12725@redhat.com>\n\t<20170922091430.GJ30661@pxdev.xzpeter.org>\n\t<20170922093631.GG12725@redhat.com>\n\t<4760b1a1-446d-fc2c-8794-8860bededc56@redhat.com>\n\t<20170922094325.GH12725@redhat.com>\n\t<d0992b81-d5d0-6957-d292-52be50a21ec7@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<d0992b81-d5d0-6957-d292-52be50a21ec7@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tFri, 22 Sep 2017 10:17:37 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"Fam Zheng <famz@redhat.com>, Stefan Hajnoczi <shajnocz@redhat.com>,\n\tqemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773444,"web_url":"http://patchwork.ozlabs.org/comment/1773444/","msgid":"<20170922101652.GF9243@stefanha-x1.localdomain>","list_archive_url":null,"date":"2017-09-22T10:16:52","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":17227,"url":"http://patchwork.ozlabs.org/api/people/17227/","name":"Stefan Hajnoczi","email":"stefanha@redhat.com"},"content":"On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n> IOThread is a general framework that contains IO loop environment and a\n> real thread behind.  It's also good to be used internally inside qemu.\n> Provide some helpers for it to create iothreads to be used internally.\n> \n> Signed-off-by: Peter Xu <peterx@redhat.com>\n> ---\n>  include/sysemu/iothread.h |  8 ++++++++\n>  iothread.c                | 21 +++++++++++++++++++++\n>  2 files changed, 29 insertions(+)\n> \n> diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n> index d2985b3..b07663f 100644\n> --- a/include/sysemu/iothread.h\n> +++ b/include/sysemu/iothread.h\n> @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n>  void iothread_stop_all(void);\n>  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n>  \n> +/*\n> + * Helpers used to allocate iothreads for internal use.  These\n> + * iothreads will not be seen by monitor clients when query using\n> + * \"query-iothreads\".\n> + */\n> +IOThread *iothread_create(const char *id, Error **errp);\n> +void iothread_destroy(IOThread *iothread);\n> +\n>  #endif /* IOTHREAD_H */\n> diff --git a/iothread.c b/iothread.c\n> index 44c8944..74e400c 100644\n> --- a/iothread.c\n> +++ b/iothread.c\n> @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n>  \n>      return iothread->worker_context;\n>  }\n> +\n> +static Object *iothread_get_internal_parent(void)\n> +{\n> +    return container_get(object_get_root(), \"/internal-iothreads\");\n> +}\n\nMarkus, please advise on the following QMP API design issue.\n\nThe query-iothreads QMP command lists IOThread objects.  This patch\nintroduces \"internal\" IOThreads whose lifetime is dictated by QEMU, not\nthe user's command-line or object-add command.\n\nQMP clients might still want to know the thread IDs of internal\nIOThreads for CPU affinity.  Clients may also want to tweak the\nAioContext polling properties on the internal objects for performance\ntuning.\n\nI suggest adding internal IOThreads alongside user-created IOThreads\ninstead of hiding them.  IOThread also needs a bool user_created field\nand a UserCreatableClass->can_be_deleted() function:\n\n  static bool iothread_can_be_deleted(UserCreatable *uc)\n  {\n      return IOTHREAD(uc)->user_created;\n  }\n\nThis way users cannot delete internal IOThreads.\n\nBut how should object ids be handled?  In theory existing -object\niothread,id=<id> users could use any name.  How can QEMU generate ids\nfor internal IOThreads without conflicting with existing users's ids?\n\n> +\n> +IOThread *iothread_create(const char *id, Error **errp)\n> +{\n> +    Object *obj;\n> +\n> +    obj = object_new_with_props(TYPE_IOTHREAD,\n> +                                iothread_get_internal_parent(),\n> +                                id, errp, NULL);\n> +\n> +    return IOTHREAD(obj);\n> +}\n> +\n> +void iothread_destroy(IOThread *iothread)\n> +{\n> +    object_unparent(OBJECT(iothread));\n> +}\n> -- \n> 2.7.4\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=stefanha@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz8cc1HG7z9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 20:20:16 +1000 (AEST)","from localhost ([::1]:57786 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvL4A-0006iA-8E\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 06:20:14 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:50870)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <stefanha@redhat.com>) id 1dvL1A-000542-HZ\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:17:09 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <stefanha@redhat.com>) id 1dvL14-0004fN-G4\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:17:08 -0400","from mx1.redhat.com ([209.132.183.28]:50980)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <stefanha@redhat.com>) id 1dvL14-0004em-72\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:17:02 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 8EBB04DAFA\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 10:17:00 +0000 (UTC)","from localhost (ovpn-116-220.ams2.redhat.com [10.36.116.220])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id F4185619F4;\n\tFri, 22 Sep 2017 10:16:53 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 8EBB04DAFA","Date":"Fri, 22 Sep 2017 11:16:52 +0100","From":"Stefan Hajnoczi <stefanha@redhat.com>","To":"Markus Armbruster <armbru@redhat.com>","Message-ID":"<20170922101652.GF9243@stefanha-x1.localdomain>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1506070572-7549-2-git-send-email-peterx@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tFri, 22 Sep 2017 10:17:00 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>, Peter Xu <peterx@redhat.com>,\n\tqemu-devel@nongnu.org, Stefan Hajnoczi <shajnocz@redhat.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773445,"web_url":"http://patchwork.ozlabs.org/comment/1773445/","msgid":"<20170922102049.GK12725@redhat.com>","list_archive_url":null,"date":"2017-09-22T10:20:49","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Fri, Sep 22, 2017 at 12:18:44PM +0200, Paolo Bonzini wrote:\n> On 22/09/2017 12:16, Stefan Hajnoczi wrote:\n> > I suggest adding internal IOThreads alongside user-created IOThreads\n> > instead of hiding them.  IOThread also needs a bool user_created field\n> > and a UserCreatableClass->can_be_deleted() function:\n> > \n> >   static bool iothread_can_be_deleted(UserCreatable *uc)\n> >   {\n> >       return IOTHREAD(uc)->user_created;\n> >   }\n> > \n> > This way users cannot delete internal IOThreads.\n> > \n> > But how should object ids be handled?  In theory existing -object\n> > iothread,id=<id> users could use any name.  How can QEMU generate ids\n> > for internal IOThreads without conflicting with existing users's ids?\n> \n> I would add an 'internal' boolean to query-iothreads' response and a new\n> 'show-internal' boolean to the command.  This way, applications that\n> request internal iothreads would know that the \"primary key\" is\n> (internal, id) rather than just the id.\n\nWhat is the app going to do with iothreads if it sees \"internal\" flag\nset ? They have no way of knowing what part of QEMU internally is using\nthis iothread, so I don't see that they can do anything intelligent\nonce they find out they exist.\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz8fC1gw0z9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 20:21:39 +1000 (AEST)","from localhost ([::1]:57795 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvL5V-0007df-7u\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 06:21:37 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:51772)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvL51-0007ca-Bd\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:21:08 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvL4y-0007Gr-NP\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:21:07 -0400","from mx1.redhat.com ([209.132.183.28]:33154)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dvL4y-0007G0-Ga\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:21:04 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 922EE20271\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 10:21:03 +0000 (UTC)","from redhat.com (unknown [10.33.36.109])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id D9863619EB;\n\tFri, 22 Sep 2017 10:20:52 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 922EE20271","Date":"Fri, 22 Sep 2017 11:20:49 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<20170922102049.GK12725@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922101652.GF9243@stefanha-x1.localdomain>\n\t<4bf59c2a-8b21-0613-5575-3dfee2762633@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<4bf59c2a-8b21-0613-5575-3dfee2762633@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tFri, 22 Sep 2017 10:21:03 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>,\n\tPeter Xu <peterx@redhat.com>, Markus Armbruster <armbru@redhat.com>, \n\tStefan Hajnoczi <shajnocz@redhat.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773446,"web_url":"http://patchwork.ozlabs.org/comment/1773446/","msgid":"<4bf59c2a-8b21-0613-5575-3dfee2762633@redhat.com>","list_archive_url":null,"date":"2017-09-22T10:18:44","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 22/09/2017 12:16, Stefan Hajnoczi wrote:\n> I suggest adding internal IOThreads alongside user-created IOThreads\n> instead of hiding them.  IOThread also needs a bool user_created field\n> and a UserCreatableClass->can_be_deleted() function:\n> \n>   static bool iothread_can_be_deleted(UserCreatable *uc)\n>   {\n>       return IOTHREAD(uc)->user_created;\n>   }\n> \n> This way users cannot delete internal IOThreads.\n> \n> But how should object ids be handled?  In theory existing -object\n> iothread,id=<id> users could use any name.  How can QEMU generate ids\n> for internal IOThreads without conflicting with existing users's ids?\n\nI would add an 'internal' boolean to query-iothreads' response and a new\n'show-internal' boolean to the command.  This way, applications that\nrequest internal iothreads would know that the \"primary key\" is\n(internal, id) rather than just the id.\n\nPaolo","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz8fQ05PMz9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 20:21:50 +1000 (AEST)","from localhost ([::1]:57796 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvL5g-0007k5-3V\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 06:21:48 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:51286)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dvL2r-00067S-Mx\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:18:54 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dvL2q-0005hN-U5\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:18:53 -0400","from mx1.redhat.com ([209.132.183.28]:44210)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>) id 1dvL2q-0005hA-OA\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:18:52 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id D89C8806CD\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 10:18:51 +0000 (UTC)","from [10.36.117.77] (ovpn-117-77.ams2.redhat.com [10.36.117.77])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 0725A62679;\n\tFri, 22 Sep 2017 10:18:45 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com D89C8806CD","To":"Stefan Hajnoczi <stefanha@redhat.com>,\n\tMarkus Armbruster <armbru@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922101652.GF9243@stefanha-x1.localdomain>","From":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<4bf59c2a-8b21-0613-5575-3dfee2762633@redhat.com>","Date":"Fri, 22 Sep 2017 12:18:44 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170922101652.GF9243@stefanha-x1.localdomain>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tFri, 22 Sep 2017 10:18:52 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org,\n\tPeter Xu <peterx@redhat.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773450,"web_url":"http://patchwork.ozlabs.org/comment/1773450/","msgid":"<e993362e-3f72-add0-bb5e-1e74830dc396@redhat.com>","list_archive_url":null,"date":"2017-09-22T10:26:16","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 22/09/2017 12:20, Daniel P. Berrange wrote:\n> On Fri, Sep 22, 2017 at 12:18:44PM +0200, Paolo Bonzini wrote:\n>> On 22/09/2017 12:16, Stefan Hajnoczi wrote:\n>>> I suggest adding internal IOThreads alongside user-created IOThreads\n>>> instead of hiding them.  IOThread also needs a bool user_created field\n>>> and a UserCreatableClass->can_be_deleted() function:\n>>>\n>>>   static bool iothread_can_be_deleted(UserCreatable *uc)\n>>>   {\n>>>       return IOTHREAD(uc)->user_created;\n>>>   }\n>>>\n>>> This way users cannot delete internal IOThreads.\n>>>\n>>> But how should object ids be handled?  In theory existing -object\n>>> iothread,id=<id> users could use any name.  How can QEMU generate ids\n>>> for internal IOThreads without conflicting with existing users's ids?\n>>\n>> I would add an 'internal' boolean to query-iothreads' response and a new\n>> 'show-internal' boolean to the command.  This way, applications that\n>> request internal iothreads would know that the \"primary key\" is\n>> (internal, id) rather than just the id.\n> \n> What is the app going to do with iothreads if it sees \"internal\" flag\n> set ? They have no way of knowing what part of QEMU internally is using\n> this iothread, so I don't see that they can do anything intelligent\n> once they find out they exist.\n\nThe application could apply them default settings for scheduler policy\nor CPU affinity.\n\nUnlike the main or the I/O thread, the monitor thread doesn't interrupt\nthe CPU, so it need not run at SCHED_FIFO even in real-time settings.\nAlternatively, the application could ensure that such threads would not\nget in the way of VCPU or I/O threads, providing slightly more stable\nperformance.\n\nPaolo","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz8mR3zwYz9sP1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 20:27:02 +1000 (AEST)","from localhost ([::1]:57834 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvLAi-00022K-AT\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 06:27:00 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:54323)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dvLAI-00020b-5t\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:26:36 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dvLAF-0001we-Go\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:26:34 -0400","from mx1.redhat.com ([209.132.183.28]:50688)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>) id 1dvLAE-0001ts-MZ\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:26:31 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id B1809C058EB1\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 10:26:29 +0000 (UTC)","from [10.36.117.77] (ovpn-117-77.ams2.redhat.com [10.36.117.77])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 9EEEB5C88B;\n\tFri, 22 Sep 2017 10:26:18 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com B1809C058EB1","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922101652.GF9243@stefanha-x1.localdomain>\n\t<4bf59c2a-8b21-0613-5575-3dfee2762633@redhat.com>\n\t<20170922102049.GK12725@redhat.com>","From":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<e993362e-3f72-add0-bb5e-1e74830dc396@redhat.com>","Date":"Fri, 22 Sep 2017 12:26:16 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170922102049.GK12725@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tFri, 22 Sep 2017 10:26:29 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>,\n\tPeter Xu <peterx@redhat.com>, Markus Armbruster <armbru@redhat.com>, \n\tStefan Hajnoczi <shajnocz@redhat.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773452,"web_url":"http://patchwork.ozlabs.org/comment/1773452/","msgid":"<20170922102808.GL12725@redhat.com>","list_archive_url":null,"date":"2017-09-22T10:28:08","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Fri, Sep 22, 2017 at 12:26:16PM +0200, Paolo Bonzini wrote:\n> On 22/09/2017 12:20, Daniel P. Berrange wrote:\n> > On Fri, Sep 22, 2017 at 12:18:44PM +0200, Paolo Bonzini wrote:\n> >> On 22/09/2017 12:16, Stefan Hajnoczi wrote:\n> >>> I suggest adding internal IOThreads alongside user-created IOThreads\n> >>> instead of hiding them.  IOThread also needs a bool user_created field\n> >>> and a UserCreatableClass->can_be_deleted() function:\n> >>>\n> >>>   static bool iothread_can_be_deleted(UserCreatable *uc)\n> >>>   {\n> >>>       return IOTHREAD(uc)->user_created;\n> >>>   }\n> >>>\n> >>> This way users cannot delete internal IOThreads.\n> >>>\n> >>> But how should object ids be handled?  In theory existing -object\n> >>> iothread,id=<id> users could use any name.  How can QEMU generate ids\n> >>> for internal IOThreads without conflicting with existing users's ids?\n> >>\n> >> I would add an 'internal' boolean to query-iothreads' response and a new\n> >> 'show-internal' boolean to the command.  This way, applications that\n> >> request internal iothreads would know that the \"primary key\" is\n> >> (internal, id) rather than just the id.\n> > \n> > What is the app going to do with iothreads if it sees \"internal\" flag\n> > set ? They have no way of knowing what part of QEMU internally is using\n> > this iothread, so I don't see that they can do anything intelligent\n> > once they find out they exist.\n> \n> The application could apply them default settings for scheduler policy\n> or CPU affinity.\n> \n> Unlike the main or the I/O thread, the monitor thread doesn't interrupt\n> the CPU, so it need not run at SCHED_FIFO even in real-time settings.\n\nThere's no way for the application to know that. ALl it sees is that there\nis an extra unexpected IOthread created internally by QEMU. There's no way\nto decide whether it nedes SCHED_FIFO or not as we've no clue what it is\nbeing used for.\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz8pS6prrz9sNw\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 20:28:48 +1000 (AEST)","from localhost ([::1]:57841 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvLCR-0002v8-1X\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 06:28:47 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:55483)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvLC5-0002ug-M9\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:28:26 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvLC3-0003Ay-15\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:28:25 -0400","from mx1.redhat.com ([209.132.183.28]:49172)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dvLC2-0003AI-PP\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:28:22 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id DD782C0733FA\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 10:28:21 +0000 (UTC)","from redhat.com (unknown [10.33.36.109])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id DD9B060842;\n\tFri, 22 Sep 2017 10:28:11 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com DD782C0733FA","Date":"Fri, 22 Sep 2017 11:28:08 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<20170922102808.GL12725@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922101652.GF9243@stefanha-x1.localdomain>\n\t<4bf59c2a-8b21-0613-5575-3dfee2762633@redhat.com>\n\t<20170922102049.GK12725@redhat.com>\n\t<e993362e-3f72-add0-bb5e-1e74830dc396@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<e993362e-3f72-add0-bb5e-1e74830dc396@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tFri, 22 Sep 2017 10:28:22 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>,\n\tPeter Xu <peterx@redhat.com>, Markus Armbruster <armbru@redhat.com>, \n\tStefan Hajnoczi <shajnocz@redhat.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773472,"web_url":"http://patchwork.ozlabs.org/comment/1773472/","msgid":"<20170922105445.GA19505@pxdev.xzpeter.org>","list_archive_url":null,"date":"2017-09-22T10:54:45","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":67717,"url":"http://patchwork.ozlabs.org/api/people/67717/","name":"Peter Xu","email":"peterx@redhat.com"},"content":"On Fri, Sep 22, 2017 at 12:14:04PM +0200, Paolo Bonzini wrote:\n> On 22/09/2017 11:43, Daniel P. Berrange wrote:\n> > On Fri, Sep 22, 2017 at 11:38:31AM +0200, Paolo Bonzini wrote:\n> >> On 22/09/2017 11:36, Daniel P. Berrange wrote:\n> >>> On Fri, Sep 22, 2017 at 05:14:30PM +0800, Peter Xu wrote:\n> >>>> On Fri, Sep 22, 2017 at 10:04:33AM +0100, Daniel P. Berrange wrote:\n> >>>>> On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n> >>>>>> IOThread is a general framework that contains IO loop environment and a\n> >>>>>> real thread behind.  It's also good to be used internally inside qemu.\n> >>>>>> Provide some helpers for it to create iothreads to be used internally.\n> >>>>>>\n> >>>>>> Signed-off-by: Peter Xu <peterx@redhat.com>\n> >>>>>> ---\n> >>>>>>  include/sysemu/iothread.h |  8 ++++++++\n> >>>>>>  iothread.c                | 21 +++++++++++++++++++++\n> >>>>>>  2 files changed, 29 insertions(+)\n> >>>>>>\n> >>>>>> diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n> >>>>>> index d2985b3..b07663f 100644\n> >>>>>> --- a/include/sysemu/iothread.h\n> >>>>>> +++ b/include/sysemu/iothread.h\n> >>>>>> @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n> >>>>>>  void iothread_stop_all(void);\n> >>>>>>  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n> >>>>>>  \n> >>>>>> +/*\n> >>>>>> + * Helpers used to allocate iothreads for internal use.  These\n> >>>>>> + * iothreads will not be seen by monitor clients when query using\n> >>>>>> + * \"query-iothreads\".\n> >>>>>> + */\n> >>>>>> +IOThread *iothread_create(const char *id, Error **errp);\n> >>>>>> +void iothread_destroy(IOThread *iothread);\n> >>>>>> +\n> >>>>>>  #endif /* IOTHREAD_H */\n> >>>>>> diff --git a/iothread.c b/iothread.c\n> >>>>>> index 44c8944..74e400c 100644\n> >>>>>> --- a/iothread.c\n> >>>>>> +++ b/iothread.c\n> >>>>>> @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n> >>>>>>  \n> >>>>>>      return iothread->worker_context;\n> >>>>>>  }\n> >>>>>> +\n> >>>>>> +static Object *iothread_get_internal_parent(void)\n> >>>>>> +{\n> >>>>>> +    return container_get(object_get_root(), \"/internal-iothreads\");\n> >>>>>> +}\n> >>>>>\n> >>>>> I tend to think we might benefit from having this generalized in the\n> >>>>> QOM API instead. We have object_get_objects_root() for things that\n> >>>>> are created by the mgmt app / user via CLI / QMP.  A parallel method\n> >>>>> object_get_internal_root() could be useful for cases like this where\n> >>>>> we want to create user-creatable objects, but not have them be\n> >>>>> visible to the mgmt app / user, as that would confuse the mgmt app.\n> >>>>>\n> >>>>> Example for this scenario - libvirt calls query-iothreads to identify\n> >>>>> IO thread PIDs, and would get very unhappy if the IOThread used by\n> >>>>> the monitor would appear in that response, which is why Peter has\n> >>>>> put it under /internal-iothreads. I think this scenario will apply\n> >>>>> more broadly, so benefit from us having a general helper in QOM.\n> >>>>\n> >>>> Yeah, I can split the patch if we want it to be exposed to public.\n> >>>>\n> >>>> In that case, would the name \"object_get_internal_root\" be good?\n> >>>\n> >>> Yeah that's fine with me, but lets see if Paolo has any thoughts from\n> >>> the QOM side.\n> >>\n> >> No, I don't.  However, I wonder if query-iothreads should have an\n> >> argument to include internal iothreads.\n> > \n> > I guess it depends whether we consider use of iothreads for migration\n> > to be a private impl detail that may be ripped out & replaced at any\n> > time, or a semi-public detail that apps may rely on.  Personally I\n> > would suggest it should be a private impl detail of migration code\n> > that is never exposed to anything outside QEMU, so we have flexibility\n> > to change it at will later.\n> \n> As far as I understood it's not migration, it's the whole monitor that\n> moves to the iothread.  So it's a thing that lasts for the whole\n> existence of the QEMU process.  But I may be wrong.\n\nYes it is about the monitor thread.\n\nOne thing to mention is that, it's not the whole monitor thread - my\nplan is only to handle QMP IOs in that thread (and execute oob\ncommands only, while oob commands should be really rare).  Most of the\nQMP command dispatching and execution will still be in main thread\n(which I suppose should be most of the real workload).\n\nIMHO I would prefer user know nothing of this thread, or tune it in\nany way.  Maybe there will be a time when we would like user to tune\nmonitor threads, but IMHO current OOB threading is not that far yet.\n\nThanks,","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=peterx@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz9Q319LBz9sP1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 20:56:11 +1000 (AEST)","from localhost ([::1]:57958 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvLcv-0004W9-BH\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 06:56:09 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:33147)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dvLbn-0003vR-Dn\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:55:02 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dvLbi-0000Q4-H5\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:54:59 -0400","from mx1.redhat.com ([209.132.183.28]:58508)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <peterx@redhat.com>) id 1dvLbi-0000P0-7W\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 06:54:54 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 0FE2B80460\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 10:54:53 +0000 (UTC)","from pxdev.xzpeter.org (ovpn-12-133.pek2.redhat.com [10.72.12.133])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id B775160A98;\n\tFri, 22 Sep 2017 10:54:48 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 0FE2B80460","Date":"Fri, 22 Sep 2017 18:54:45 +0800","From":"Peter Xu <peterx@redhat.com>","To":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<20170922105445.GA19505@pxdev.xzpeter.org>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922090433.GC12725@redhat.com>\n\t<20170922091430.GJ30661@pxdev.xzpeter.org>\n\t<20170922093631.GG12725@redhat.com>\n\t<4760b1a1-446d-fc2c-8794-8860bededc56@redhat.com>\n\t<20170922094325.GH12725@redhat.com>\n\t<d0992b81-d5d0-6957-d292-52be50a21ec7@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<d0992b81-d5d0-6957-d292-52be50a21ec7@redhat.com>","User-Agent":"Mutt/1.5.24 (2015-08-30)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tFri, 22 Sep 2017 10:54:53 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>, Stefan Hajnoczi <shajnocz@redhat.com>,\n\tqemu-devel@nongnu.org, \"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773570,"web_url":"http://patchwork.ozlabs.org/comment/1773570/","msgid":"<20170922125932.GD32000@lemon>","list_archive_url":null,"date":"2017-09-22T12:59:32","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Fri, 09/22 11:17, Daniel P. Berrange wrote:\n> Sorry yes, my bad - its the iothread behind the monitor. I still think that\n> is a detail worth keeping private in case we want to refactor how the\n> monitor threading works later.\n\nI agree. I convinced Peter to reuse IOThread just because we can, but we don't\nneed to expose it to user just because we can. Like Daniel, I also see no reason\nto do that at this point, and I think we can always do it later when necesssary.\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xzD9N5DJ3z9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 23:00:23 +1000 (AEST)","from localhost ([::1]:58794 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvNZ7-0005Rn-3a\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 09:00:21 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37498)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dvNYT-0005QR-Uc\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 08:59:42 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dvNYQ-0005L6-06\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 08:59:42 -0400","from mx1.redhat.com ([209.132.183.28]:55252)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dvNYP-0005Jk-QF\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 08:59:37 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 9BEEB7F3F3\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 12:59:36 +0000 (UTC)","from localhost (ovpn-12-35.pek2.redhat.com [10.72.12.35])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id CDD77600CD;\n\tFri, 22 Sep 2017 12:59:33 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 9BEEB7F3F3","Date":"Fri, 22 Sep 2017 20:59:32 +0800","From":"Fam Zheng <famz@redhat.com>","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Message-ID":"<20170922125932.GD32000@lemon>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922090433.GC12725@redhat.com>\n\t<20170922091430.GJ30661@pxdev.xzpeter.org>\n\t<20170922093631.GG12725@redhat.com>\n\t<4760b1a1-446d-fc2c-8794-8860bededc56@redhat.com>\n\t<20170922094325.GH12725@redhat.com>\n\t<d0992b81-d5d0-6957-d292-52be50a21ec7@redhat.com>\n\t<20170922101728.GJ12725@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170922101728.GJ12725@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tFri, 22 Sep 2017 12:59:36 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>, \n\tqemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773575,"web_url":"http://patchwork.ozlabs.org/comment/1773575/","msgid":"<3dfdb428-9d5d-5f26-c101-1782bb8e68f4@redhat.com>","list_archive_url":null,"date":"2017-09-22T13:03:33","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 22/09/2017 14:59, Fam Zheng wrote:\n> On Fri, 09/22 11:17, Daniel P. Berrange wrote:\n>> Sorry yes, my bad - its the iothread behind the monitor. I still think that\n>> is a detail worth keeping private in case we want to refactor how the\n>> monitor threading works later.\n> I agree. I convinced Peter to reuse IOThread just because we can, but we don't\n> need to expose it to user just because we can. Like Daniel, I also see no reason\n> to do that at this point, and I think we can always do it later when necesssary.\n\nGreat. :)\n\nPaolo","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=208.118.235.17; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [208.118.235.17])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xzDGK0R1yz9sP1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 23:04:41 +1000 (AEST)","from localhost ([::1]:58829 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvNdH-0008Kh-3r\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 09:04:39 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39070)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dvNcc-0008Iv-Hu\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 09:04:00 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dvNcW-0000wi-Ol\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 09:03:58 -0400","from mx1.redhat.com ([209.132.183.28]:46098)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>) id 1dvNcW-0000uq-JY\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 09:03:52 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 7E69EC05178E\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 13:03:51 +0000 (UTC)","from [10.36.117.77] (ovpn-117-77.ams2.redhat.com [10.36.117.77])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 45EFF63623;\n\tFri, 22 Sep 2017 13:03:35 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 7E69EC05178E","To":"Fam Zheng <famz@redhat.com>, \"Daniel P. Berrange\" <berrange@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922090433.GC12725@redhat.com>\n\t<20170922091430.GJ30661@pxdev.xzpeter.org>\n\t<20170922093631.GG12725@redhat.com>\n\t<4760b1a1-446d-fc2c-8794-8860bededc56@redhat.com>\n\t<20170922094325.GH12725@redhat.com>\n\t<d0992b81-d5d0-6957-d292-52be50a21ec7@redhat.com>\n\t<20170922101728.GJ12725@redhat.com> <20170922125932.GD32000@lemon>","From":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<3dfdb428-9d5d-5f26-c101-1782bb8e68f4@redhat.com>","Date":"Fri, 22 Sep 2017 15:03:33 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170922125932.GD32000@lemon>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tFri, 22 Sep 2017 13:03:51 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Stefan Hajnoczi <shajnocz@redhat.com>, qemu-devel@nongnu.org,\n\tPeter Xu <peterx@redhat.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773580,"web_url":"http://patchwork.ozlabs.org/comment/1773580/","msgid":"<20170922130922.GF32000@lemon>","list_archive_url":null,"date":"2017-09-22T13:09:22","subject":"Re: [Qemu-devel] [PATCH 3/3] iothread: delay the context release to\n\tfinalize","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Fri, 09/22 16:56, Peter Xu wrote:\n> When gcontext is used with iothread, the context will be destroyed\n> during iothread_stop().  That's not good since sometimes we would like\n> to keep the resources until iothread is destroyed, but we may want to\n> stop the thread before that point.\n\nWould be nice if you can also mention the glib bug that \"required\" this in the\ncommit message.\n\nReviewed-by: Fam Zheng <famz@redhat.com>\n\n> \n> Delay the destruction of gcontext to iothread finalize.  Then we can do:\n> \n>   iothread_stop(thread);\n>   some_cleanup_on_resources();\n>   iothread_destroy(thread);\n> \n> Signed-off-by: Peter Xu <peterx@redhat.com>\n> ---\n>  iothread.c | 6 ++++--\n>  1 file changed, 4 insertions(+), 2 deletions(-)\n> \n> diff --git a/iothread.c b/iothread.c\n> index 894756b..b95369b 100644\n> --- a/iothread.c\n> +++ b/iothread.c\n> @@ -71,8 +71,6 @@ static void *iothread_run(void *opaque)\n>              g_main_loop_unref(loop);\n>  \n>              g_main_context_pop_thread_default(iothread->worker_context);\n> -            g_main_context_unref(iothread->worker_context);\n> -            iothread->worker_context = NULL;\n>          }\n>      }\n>  \n> @@ -117,6 +115,10 @@ static void iothread_instance_finalize(Object *obj)\n>      IOThread *iothread = IOTHREAD(obj);\n>  \n>      iothread_stop(iothread);\n> +    if (iothread->worker_context) {\n> +        g_main_context_unref(iothread->worker_context);\n> +        iothread->worker_context = NULL;\n> +    }\n>      qemu_cond_destroy(&iothread->init_done_cond);\n>      qemu_mutex_destroy(&iothread->init_done_lock);\n>      if (!iothread->ctx) {\n> -- \n> 2.7.4\n> \n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=208.118.235.17; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [208.118.235.17])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xzDNZ0HPMz9sP1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 23:10:06 +1000 (AEST)","from localhost ([::1]:58852 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvNiW-000398-3x\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 09:10:04 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:40720)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dvNi1-00037j-2F\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 09:09:33 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dvNhx-0005J3-PF\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 09:09:33 -0400","from mx1.redhat.com ([209.132.183.28]:48184)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dvNhx-0005IF-Hl\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 09:09:29 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id AEA2C806CC\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 13:09:28 +0000 (UTC)","from localhost (ovpn-12-35.pek2.redhat.com [10.72.12.35])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 0D01A5C890;\n\tFri, 22 Sep 2017 13:09:23 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com AEA2C806CC","Date":"Fri, 22 Sep 2017 21:09:22 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Peter Xu <peterx@redhat.com>","Message-ID":"<20170922130922.GF32000@lemon>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-4-git-send-email-peterx@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1506070572-7549-4-git-send-email-peterx@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tFri, 22 Sep 2017 13:09:28 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/3] iothread: delay the context release to\n\tfinalize","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>, \n\tqemu-devel@nongnu.org, \"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773668,"web_url":"http://patchwork.ozlabs.org/comment/1773668/","msgid":"<20170922143505.GB13709@stefanha-x1.localdomain>","list_archive_url":null,"date":"2017-09-22T14:35:05","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":17227,"url":"http://patchwork.ozlabs.org/api/people/17227/","name":"Stefan Hajnoczi","email":"stefanha@redhat.com"},"content":"On Fri, Sep 22, 2017 at 11:28:08AM +0100, Daniel P. Berrange wrote:\n> On Fri, Sep 22, 2017 at 12:26:16PM +0200, Paolo Bonzini wrote:\n> > On 22/09/2017 12:20, Daniel P. Berrange wrote:\n> > > On Fri, Sep 22, 2017 at 12:18:44PM +0200, Paolo Bonzini wrote:\n> > >> On 22/09/2017 12:16, Stefan Hajnoczi wrote:\n> > >>> I suggest adding internal IOThreads alongside user-created IOThreads\n> > >>> instead of hiding them.  IOThread also needs a bool user_created field\n> > >>> and a UserCreatableClass->can_be_deleted() function:\n> > >>>\n> > >>>   static bool iothread_can_be_deleted(UserCreatable *uc)\n> > >>>   {\n> > >>>       return IOTHREAD(uc)->user_created;\n> > >>>   }\n> > >>>\n> > >>> This way users cannot delete internal IOThreads.\n> > >>>\n> > >>> But how should object ids be handled?  In theory existing -object\n> > >>> iothread,id=<id> users could use any name.  How can QEMU generate ids\n> > >>> for internal IOThreads without conflicting with existing users's ids?\n> > >>\n> > >> I would add an 'internal' boolean to query-iothreads' response and a new\n> > >> 'show-internal' boolean to the command.  This way, applications that\n> > >> request internal iothreads would know that the \"primary key\" is\n> > >> (internal, id) rather than just the id.\n> > > \n> > > What is the app going to do with iothreads if it sees \"internal\" flag\n> > > set ? They have no way of knowing what part of QEMU internally is using\n> > > this iothread, so I don't see that they can do anything intelligent\n> > > once they find out they exist.\n> > \n> > The application could apply them default settings for scheduler policy\n> > or CPU affinity.\n> > \n> > Unlike the main or the I/O thread, the monitor thread doesn't interrupt\n> > the CPU, so it need not run at SCHED_FIFO even in real-time settings.\n> \n> There's no way for the application to know that. ALl it sees is that there\n> is an extra unexpected IOthread created internally by QEMU. There's no way\n> to decide whether it nedes SCHED_FIFO or not as we've no clue what it is\n> being used for.\n\nFor observability (troubleshooting, debugging, etc) I would like all\nIOThreads to be visible.  That makes it much easier to troubleshoot in a\nunified way rather than having to get at internal IOThreads through\ndifferent means (e.g. gdb).\n\nIf QEMU uses a well-known ID for the internal monitor IOThread then\nlibvirt could also interact with it (e.g. CPU affinity).\n\nOne day maybe the main loop thread will also be an internal IOThread.\n\nStefan","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=stefanha@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xzGHl34DBz9sP1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 23 Sep 2017 00:36:03 +1000 (AEST)","from localhost ([::1]:59228 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvP3h-00068a-Gj\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 10:36:01 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38053)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <stefanha@redhat.com>) id 1dvP32-00066s-3O\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 10:35:21 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <stefanha@redhat.com>) id 1dvP2y-00064f-VZ\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 10:35:20 -0400","from mx1.redhat.com ([209.132.183.28]:46570)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <stefanha@redhat.com>) id 1dvP2y-000647-Nn\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 10:35:16 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id CE0A41F56A\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 14:35:15 +0000 (UTC)","from localhost (ovpn-116-220.ams2.redhat.com [10.36.116.220])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id DD6866954E;\n\tFri, 22 Sep 2017 14:35:06 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com CE0A41F56A","Date":"Fri, 22 Sep 2017 15:35:05 +0100","From":"Stefan Hajnoczi <stefanha@redhat.com>","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Message-ID":"<20170922143505.GB13709@stefanha-x1.localdomain>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922101652.GF9243@stefanha-x1.localdomain>\n\t<4bf59c2a-8b21-0613-5575-3dfee2762633@redhat.com>\n\t<20170922102049.GK12725@redhat.com>\n\t<e993362e-3f72-add0-bb5e-1e74830dc396@redhat.com>\n\t<20170922102808.GL12725@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170922102808.GL12725@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tFri, 22 Sep 2017 14:35:15 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org,\n\tMarkus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, \n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1773690,"web_url":"http://patchwork.ozlabs.org/comment/1773690/","msgid":"<20170922145540.GQ12725@redhat.com>","list_archive_url":null,"date":"2017-09-22T14:55:40","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Fri, Sep 22, 2017 at 03:35:05PM +0100, Stefan Hajnoczi wrote:\n> On Fri, Sep 22, 2017 at 11:28:08AM +0100, Daniel P. Berrange wrote:\n> > On Fri, Sep 22, 2017 at 12:26:16PM +0200, Paolo Bonzini wrote:\n> > > On 22/09/2017 12:20, Daniel P. Berrange wrote:\n> > > > On Fri, Sep 22, 2017 at 12:18:44PM +0200, Paolo Bonzini wrote:\n> > > >> On 22/09/2017 12:16, Stefan Hajnoczi wrote:\n> > > >>> I suggest adding internal IOThreads alongside user-created IOThreads\n> > > >>> instead of hiding them.  IOThread also needs a bool user_created field\n> > > >>> and a UserCreatableClass->can_be_deleted() function:\n> > > >>>\n> > > >>>   static bool iothread_can_be_deleted(UserCreatable *uc)\n> > > >>>   {\n> > > >>>       return IOTHREAD(uc)->user_created;\n> > > >>>   }\n> > > >>>\n> > > >>> This way users cannot delete internal IOThreads.\n> > > >>>\n> > > >>> But how should object ids be handled?  In theory existing -object\n> > > >>> iothread,id=<id> users could use any name.  How can QEMU generate ids\n> > > >>> for internal IOThreads without conflicting with existing users's ids?\n> > > >>\n> > > >> I would add an 'internal' boolean to query-iothreads' response and a new\n> > > >> 'show-internal' boolean to the command.  This way, applications that\n> > > >> request internal iothreads would know that the \"primary key\" is\n> > > >> (internal, id) rather than just the id.\n> > > > \n> > > > What is the app going to do with iothreads if it sees \"internal\" flag\n> > > > set ? They have no way of knowing what part of QEMU internally is using\n> > > > this iothread, so I don't see that they can do anything intelligent\n> > > > once they find out they exist.\n> > > \n> > > The application could apply them default settings for scheduler policy\n> > > or CPU affinity.\n> > > \n> > > Unlike the main or the I/O thread, the monitor thread doesn't interrupt\n> > > the CPU, so it need not run at SCHED_FIFO even in real-time settings.\n> > \n> > There's no way for the application to know that. ALl it sees is that there\n> > is an extra unexpected IOthread created internally by QEMU. There's no way\n> > to decide whether it nedes SCHED_FIFO or not as we've no clue what it is\n> > being used for.\n> \n> For observability (troubleshooting, debugging, etc) I would like all\n> IOThreads to be visible.  That makes it much easier to troubleshoot in a\n> unified way rather than having to get at internal IOThreads through\n> different means (e.g. gdb).\n> \n> If QEMU uses a well-known ID for the internal monitor IOThread then\n> libvirt could also interact with it (e.g. CPU affinity).\n\nI don't think we should abuse ID values by turning them into stable\nABI - currently they are opaque tokens whose value has no special\nmeaning and make change at will over time.\n\nIf we need to be able to report the IOthread for the monitor, then it\nwould have to be done via a formal API, but that turns the use of\nIOThreads for the monitor into a feature we have to keep indefinitely,\neven if we wanted to re-implement it differently later.\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xzGlK2Pd9z9s7p\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 23 Sep 2017 00:56:27 +1000 (AEST)","from localhost ([::1]:59288 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvPNP-0005lk-89\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 10:56:23 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:44843)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvPN4-0005lX-07\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 10:56:03 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dvPN0-0001x7-Q3\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 10:56:02 -0400","from mx1.redhat.com ([209.132.183.28]:48128)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dvPN0-0001wi-Fs\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 10:55:58 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 4B307C0578F5\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 14:55:57 +0000 (UTC)","from redhat.com (unknown [10.33.36.109])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 741456E703;\n\tFri, 22 Sep 2017 14:55:43 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 4B307C0578F5","Date":"Fri, 22 Sep 2017 15:55:40 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Stefan Hajnoczi <stefanha@redhat.com>","Message-ID":"<20170922145540.GQ12725@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922101652.GF9243@stefanha-x1.localdomain>\n\t<4bf59c2a-8b21-0613-5575-3dfee2762633@redhat.com>\n\t<20170922102049.GK12725@redhat.com>\n\t<e993362e-3f72-add0-bb5e-1e74830dc396@redhat.com>\n\t<20170922102808.GL12725@redhat.com>\n\t<20170922143505.GB13709@stefanha-x1.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170922143505.GB13709@stefanha-x1.localdomain>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tFri, 22 Sep 2017 14:55:57 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org,\n\tMarkus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, \n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1774417,"web_url":"http://patchwork.ozlabs.org/comment/1774417/","msgid":"<20170925052330.GC19505@pxdev.xzpeter.org>","list_archive_url":null,"date":"2017-09-25T05:23:30","subject":"Re: [Qemu-devel] [PATCH 3/3] iothread: delay the context release to\n\tfinalize","submitter":{"id":67717,"url":"http://patchwork.ozlabs.org/api/people/67717/","name":"Peter Xu","email":"peterx@redhat.com"},"content":"On Fri, Sep 22, 2017 at 09:09:22PM +0800, Fam Zheng wrote:\n> On Fri, 09/22 16:56, Peter Xu wrote:\n> > When gcontext is used with iothread, the context will be destroyed\n> > during iothread_stop().  That's not good since sometimes we would like\n> > to keep the resources until iothread is destroyed, but we may want to\n> > stop the thread before that point.\n> \n> Would be nice if you can also mention the glib bug that \"required\" this in the\n> commit message.\n\nI can add it, but I am not sure it's very closely related (and I'm\nafraid that may confuse more people).  Say, even without that bug, I\nwould still think it not a good idea to free the context in the loop,\nespecially considering that we have the finalize function there.  Thanks,\n\n> \n> Reviewed-by: Fam Zheng <famz@redhat.com>\n> \n> > \n> > Delay the destruction of gcontext to iothread finalize.  Then we can do:\n> > \n> >   iothread_stop(thread);\n> >   some_cleanup_on_resources();\n> >   iothread_destroy(thread);\n> > \n> > Signed-off-by: Peter Xu <peterx@redhat.com>\n> > ---\n> >  iothread.c | 6 ++++--\n> >  1 file changed, 4 insertions(+), 2 deletions(-)\n> > \n> > diff --git a/iothread.c b/iothread.c\n> > index 894756b..b95369b 100644\n> > --- a/iothread.c\n> > +++ b/iothread.c\n> > @@ -71,8 +71,6 @@ static void *iothread_run(void *opaque)\n> >              g_main_loop_unref(loop);\n> >  \n> >              g_main_context_pop_thread_default(iothread->worker_context);\n> > -            g_main_context_unref(iothread->worker_context);\n> > -            iothread->worker_context = NULL;\n> >          }\n> >      }\n> >  \n> > @@ -117,6 +115,10 @@ static void iothread_instance_finalize(Object *obj)\n> >      IOThread *iothread = IOTHREAD(obj);\n> >  \n> >      iothread_stop(iothread);\n> > +    if (iothread->worker_context) {\n> > +        g_main_context_unref(iothread->worker_context);\n> > +        iothread->worker_context = NULL;\n> > +    }\n> >      qemu_cond_destroy(&iothread->init_done_cond);\n> >      qemu_mutex_destroy(&iothread->init_done_lock);\n> >      if (!iothread->ctx) {\n> > -- \n> > 2.7.4\n> > \n> >","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=peterx@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0svf3MKdz9t4Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 15:24:12 +1000 (AEST)","from localhost ([::1]:40749 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwLsG-0002tB-Mm\n\tfor incoming@patchwork.ozlabs.org; Mon, 25 Sep 2017 01:24:08 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42776)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dwLrq-0002st-LJ\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:23:43 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dwLrn-000733-Hc\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:23:42 -0400","from mx1.redhat.com ([209.132.183.28]:60900)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <peterx@redhat.com>) id 1dwLrn-00072d-BD\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:23:39 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 0C4CB10F74\n\tfor <qemu-devel@nongnu.org>; Mon, 25 Sep 2017 05:23:38 +0000 (UTC)","from pxdev.xzpeter.org (dhcp-15-224.nay.redhat.com [10.66.15.224])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 34CB65C545;\n\tMon, 25 Sep 2017 05:23:34 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 0C4CB10F74","Date":"Mon, 25 Sep 2017 13:23:30 +0800","From":"Peter Xu <peterx@redhat.com>","To":"Fam Zheng <famz@redhat.com>","Message-ID":"<20170925052330.GC19505@pxdev.xzpeter.org>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-4-git-send-email-peterx@redhat.com>\n\t<20170922130922.GF32000@lemon>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170922130922.GF32000@lemon>","User-Agent":"Mutt/1.5.24 (2015-08-30)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tMon, 25 Sep 2017 05:23:38 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/3] iothread: delay the context release to\n\tfinalize","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>, \n\tqemu-devel@nongnu.org, \"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1774422,"web_url":"http://patchwork.ozlabs.org/comment/1774422/","msgid":"<20170925053002.GA398@lemon.lan>","list_archive_url":null,"date":"2017-09-25T05:30:02","subject":"Re: [Qemu-devel] [PATCH 3/3] iothread: delay the context release to\n\tfinalize","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Mon, 09/25 13:23, Peter Xu wrote:\n> On Fri, Sep 22, 2017 at 09:09:22PM +0800, Fam Zheng wrote:\n> > On Fri, 09/22 16:56, Peter Xu wrote:\n> > > When gcontext is used with iothread, the context will be destroyed\n> > > during iothread_stop().  That's not good since sometimes we would like\n> > > to keep the resources until iothread is destroyed, but we may want to\n> > > stop the thread before that point.\n> > \n> > Would be nice if you can also mention the glib bug that \"required\" this in the\n> > commit message.\n> \n> I can add it, but I am not sure it's very closely related (and I'm\n> afraid that may confuse more people).  Say, even without that bug, I\n> would still think it not a good idea to free the context in the loop,\n> especially considering that we have the finalize function there.  Thanks,\n\nIt's interesting to know if or not your future change will break without this\npatch, this is especially useful for backport.\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0t3914xNz9t5b\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 15:30:43 +1000 (AEST)","from localhost ([::1]:40768 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwLya-0004ny-7U\n\tfor incoming@patchwork.ozlabs.org; Mon, 25 Sep 2017 01:30:40 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:43788)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dwLyE-0004ns-8l\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:30:19 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dwLy9-00022h-C0\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:30:18 -0400","from mx1.redhat.com ([209.132.183.28]:47848)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dwLy9-00021l-68\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:30:13 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id E5BB385550\n\tfor <qemu-devel@nongnu.org>; Mon, 25 Sep 2017 05:30:11 +0000 (UTC)","from localhost (ovpn-12-91.pek2.redhat.com [10.72.12.91])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 54B8961980;\n\tMon, 25 Sep 2017 05:30:03 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com E5BB385550","Date":"Mon, 25 Sep 2017 13:30:02 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Peter Xu <peterx@redhat.com>","Message-ID":"<20170925053002.GA398@lemon.lan>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-4-git-send-email-peterx@redhat.com>\n\t<20170922130922.GF32000@lemon>\n\t<20170925052330.GC19505@pxdev.xzpeter.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170925052330.GC19505@pxdev.xzpeter.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tMon, 25 Sep 2017 05:30:12 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/3] iothread: delay the context release to\n\tfinalize","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>, \n\tqemu-devel@nongnu.org, \"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1774430,"web_url":"http://patchwork.ozlabs.org/comment/1774430/","msgid":"<20170925055034.GD19505@pxdev.xzpeter.org>","list_archive_url":null,"date":"2017-09-25T05:50:34","subject":"Re: [Qemu-devel] [PATCH 3/3] iothread: delay the context release to\n\tfinalize","submitter":{"id":67717,"url":"http://patchwork.ozlabs.org/api/people/67717/","name":"Peter Xu","email":"peterx@redhat.com"},"content":"On Mon, Sep 25, 2017 at 01:30:02PM +0800, Fam Zheng wrote:\n> On Mon, 09/25 13:23, Peter Xu wrote:\n> > On Fri, Sep 22, 2017 at 09:09:22PM +0800, Fam Zheng wrote:\n> > > On Fri, 09/22 16:56, Peter Xu wrote:\n> > > > When gcontext is used with iothread, the context will be destroyed\n> > > > during iothread_stop().  That's not good since sometimes we would like\n> > > > to keep the resources until iothread is destroyed, but we may want to\n> > > > stop the thread before that point.\n> > > \n> > > Would be nice if you can also mention the glib bug that \"required\" this in the\n> > > commit message.\n> > \n> > I can add it, but I am not sure it's very closely related (and I'm\n> > afraid that may confuse more people).  Say, even without that bug, I\n> > would still think it not a good idea to free the context in the loop,\n> > especially considering that we have the finalize function there.  Thanks,\n> \n> It's interesting to know if or not your future change will break without this\n> patch, this is especially useful for backport.\n\nI haven't tried to run with iothread and without this patch, but I\nthink it should fail, so this patch should be needed.\n\nThe point is that we should not destroy the context before explicitly\ncalling remove_fd_in_watch() if the context is running chardevs.\nWithout this patch, this rule does not satisfy.  And IIUC this rule\ncomes from the glib bug.\n\nAnyway, I'll mention it in commit message to clarify.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=peterx@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0tVv3pCpz9t4B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 15:51:11 +1000 (AEST)","from localhost ([::1]:40809 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwMIM-000341-GA\n\tfor incoming@patchwork.ozlabs.org; Mon, 25 Sep 2017 01:51:06 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:46227)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dwMI1-00033l-Nm\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:50:46 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dwMHx-0003LV-Ra\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:50:45 -0400","from mx1.redhat.com ([209.132.183.28]:53092)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <peterx@redhat.com>) id 1dwMHx-0003KV-Cn\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:50:41 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 22D15267C5\n\tfor <qemu-devel@nongnu.org>; Mon, 25 Sep 2017 05:50:40 +0000 (UTC)","from pxdev.xzpeter.org (dhcp-15-224.nay.redhat.com [10.66.15.224])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 4DDDE61992;\n\tMon, 25 Sep 2017 05:50:36 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 22D15267C5","Date":"Mon, 25 Sep 2017 13:50:34 +0800","From":"Peter Xu <peterx@redhat.com>","To":"Fam Zheng <famz@redhat.com>","Message-ID":"<20170925055034.GD19505@pxdev.xzpeter.org>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-4-git-send-email-peterx@redhat.com>\n\t<20170922130922.GF32000@lemon>\n\t<20170925052330.GC19505@pxdev.xzpeter.org>\n\t<20170925053002.GA398@lemon.lan>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170925053002.GA398@lemon.lan>","User-Agent":"Mutt/1.5.24 (2015-08-30)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tMon, 25 Sep 2017 05:50:40 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/3] iothread: delay the context release to\n\tfinalize","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>, \n\tqemu-devel@nongnu.org, \"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1774432,"web_url":"http://patchwork.ozlabs.org/comment/1774432/","msgid":"<20170925055812.GB398@lemon.lan>","list_archive_url":null,"date":"2017-09-25T05:58:12","subject":"Re: [Qemu-devel] [PATCH 3/3] iothread: delay the context release to\n\tfinalize","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Mon, 09/25 13:50, Peter Xu wrote:\n> On Mon, Sep 25, 2017 at 01:30:02PM +0800, Fam Zheng wrote:\n> > On Mon, 09/25 13:23, Peter Xu wrote:\n> > > On Fri, Sep 22, 2017 at 09:09:22PM +0800, Fam Zheng wrote:\n> > > > On Fri, 09/22 16:56, Peter Xu wrote:\n> > > > > When gcontext is used with iothread, the context will be destroyed\n> > > > > during iothread_stop().  That's not good since sometimes we would like\n> > > > > to keep the resources until iothread is destroyed, but we may want to\n> > > > > stop the thread before that point.\n> > > > \n> > > > Would be nice if you can also mention the glib bug that \"required\" this in the\n> > > > commit message.\n> > > \n> > > I can add it, but I am not sure it's very closely related (and I'm\n> > > afraid that may confuse more people).  Say, even without that bug, I\n> > > would still think it not a good idea to free the context in the loop,\n> > > especially considering that we have the finalize function there.  Thanks,\n> > \n> > It's interesting to know if or not your future change will break without this\n> > patch, this is especially useful for backport.\n> \n> I haven't tried to run with iothread and without this patch, but I\n> think it should fail, so this patch should be needed.\n> \n> The point is that we should not destroy the context before explicitly\n> calling remove_fd_in_watch() if the context is running chardevs.\n> Without this patch, this rule does not satisfy.  And IIUC this rule\n> comes from the glib bug.\n> \n> Anyway, I'll mention it in commit message to clarify.\n\nOK, thanks for the explanations! My r-b still stands with the amended commit\nlog.\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0tgT3FyNz9t5b\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 15:58:44 +1000 (AEST)","from localhost ([::1]:40825 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwMPh-00056N-PN\n\tfor incoming@patchwork.ozlabs.org; Mon, 25 Sep 2017 01:58:41 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47105)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dwMPO-000567-1M\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:58:22 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dwMPK-0008Bp-Uu\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:58:22 -0400","from mx1.redhat.com ([209.132.183.28]:47802)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dwMPK-0008Ap-OB\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 01:58:18 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 810B32F944D\n\tfor <qemu-devel@nongnu.org>; Mon, 25 Sep 2017 05:58:17 +0000 (UTC)","from localhost (ovpn-12-91.pek2.redhat.com [10.72.12.91])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id B54011711B;\n\tMon, 25 Sep 2017 05:58:14 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 810B32F944D","Date":"Mon, 25 Sep 2017 13:58:12 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Peter Xu <peterx@redhat.com>","Message-ID":"<20170925055812.GB398@lemon.lan>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-4-git-send-email-peterx@redhat.com>\n\t<20170922130922.GF32000@lemon>\n\t<20170925052330.GC19505@pxdev.xzpeter.org>\n\t<20170925053002.GA398@lemon.lan>\n\t<20170925055034.GD19505@pxdev.xzpeter.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170925055034.GD19505@pxdev.xzpeter.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tMon, 25 Sep 2017 05:58:17 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/3] iothread: delay the context release to\n\tfinalize","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>, \n\tqemu-devel@nongnu.org, \"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1778475,"web_url":"http://patchwork.ozlabs.org/comment/1778475/","msgid":"<87h8vh1nar.fsf@dusky.pond.sub.org>","list_archive_url":null,"date":"2017-10-02T17:18:04","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":2645,"url":"http://patchwork.ozlabs.org/api/people/2645/","name":"Markus Armbruster","email":"armbru@redhat.com"},"content":"Stefan Hajnoczi <stefanha@redhat.com> writes:\n\n> On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n>> IOThread is a general framework that contains IO loop environment and a\n>> real thread behind.  It's also good to be used internally inside qemu.\n>> Provide some helpers for it to create iothreads to be used internally.\n>> \n>> Signed-off-by: Peter Xu <peterx@redhat.com>\n>> ---\n>>  include/sysemu/iothread.h |  8 ++++++++\n>>  iothread.c                | 21 +++++++++++++++++++++\n>>  2 files changed, 29 insertions(+)\n>> \n>> diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n>> index d2985b3..b07663f 100644\n>> --- a/include/sysemu/iothread.h\n>> +++ b/include/sysemu/iothread.h\n>> @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n>>  void iothread_stop_all(void);\n>>  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n>>  \n>> +/*\n>> + * Helpers used to allocate iothreads for internal use.  These\n>> + * iothreads will not be seen by monitor clients when query using\n>> + * \"query-iothreads\".\n>> + */\n>> +IOThread *iothread_create(const char *id, Error **errp);\n>> +void iothread_destroy(IOThread *iothread);\n>> +\n>>  #endif /* IOTHREAD_H */\n>> diff --git a/iothread.c b/iothread.c\n>> index 44c8944..74e400c 100644\n>> --- a/iothread.c\n>> +++ b/iothread.c\n>> @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n>>  \n>>      return iothread->worker_context;\n>>  }\n>> +\n>> +static Object *iothread_get_internal_parent(void)\n>> +{\n>> +    return container_get(object_get_root(), \"/internal-iothreads\");\n>> +}\n>\n> Markus, please advise on the following QMP API design issue.\n\nSorry for the slow response.  Is my advice still needed, or are you\ngood?","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=armbru@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y5TQz1nnqz9t5R\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  3 Oct 2017 04:18:51 +1100 (AEDT)","from localhost ([::1]:53479 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org>)\n\tid 1dz4Mi-00065W-SJ\n\tfor incoming@patchwork.ozlabs.org; Mon, 02 Oct 2017 13:18:48 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:58139)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1dz4MF-00064C-Sv\n\tfor qemu-devel@nongnu.org; Mon, 02 Oct 2017 13:18:20 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1dz4MC-0006e4-Pl\n\tfor qemu-devel@nongnu.org; Mon, 02 Oct 2017 13:18:19 -0400","from mx1.redhat.com ([209.132.183.28]:36562)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <armbru@redhat.com>) id 1dz4MC-0006dU-J9\n\tfor qemu-devel@nongnu.org; Mon, 02 Oct 2017 13:18:16 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id B2E7FC0587C6\n\tfor <qemu-devel@nongnu.org>; Mon,  2 Oct 2017 17:18:15 +0000 (UTC)","from blackfin.pond.sub.org (ovpn-116-91.ams2.redhat.com\n\t[10.36.116.91])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 245B795210;\n\tMon,  2 Oct 2017 17:18:06 +0000 (UTC)","by blackfin.pond.sub.org (Postfix, from userid 1000)\n\tid 5E8361132D34; Mon,  2 Oct 2017 19:18:04 +0200 (CEST)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com B2E7FC0587C6","From":"Markus Armbruster <armbru@redhat.com>","To":"Stefan Hajnoczi <stefanha@redhat.com>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922101652.GF9243@stefanha-x1.localdomain>","Date":"Mon, 02 Oct 2017 19:18:04 +0200","In-Reply-To":"<20170922101652.GF9243@stefanha-x1.localdomain> (Stefan\n\tHajnoczi's message of \"Fri, 22 Sep 2017 11:16:52 +0100\")","Message-ID":"<87h8vh1nar.fsf@dusky.pond.sub.org>","User-Agent":"Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)","MIME-Version":"1.0","Content-Type":"text/plain","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tMon, 02 Oct 2017 17:18:15 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@gnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.gnu.org>","List-Unsubscribe":"<https://lists.gnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@gnu.org?subject=unsubscribe>","List-Archive":"<http://lists.gnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@gnu.org>","List-Help":"<mailto:qemu-devel-request@gnu.org?subject=help>","List-Subscribe":"<https://lists.gnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@gnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>,\n\tPeter Xu <peterx@redhat.com>, qemu-devel@nongnu.org,\n\tStefan Hajnoczi <shajnocz@redhat.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org>"}},{"id":1782245,"web_url":"http://patchwork.ozlabs.org/comment/1782245/","msgid":"<20171008124614.GA7792@pxdev.xzpeter.org>","list_archive_url":null,"date":"2017-10-08T12:46:14","subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","submitter":{"id":67717,"url":"http://patchwork.ozlabs.org/api/people/67717/","name":"Peter Xu","email":"peterx@redhat.com"},"content":"On Mon, Oct 02, 2017 at 07:18:04PM +0200, Markus Armbruster wrote:\n> Stefan Hajnoczi <stefanha@redhat.com> writes:\n> \n> > On Fri, Sep 22, 2017 at 04:56:10PM +0800, Peter Xu wrote:\n> >> IOThread is a general framework that contains IO loop environment and a\n> >> real thread behind.  It's also good to be used internally inside qemu.\n> >> Provide some helpers for it to create iothreads to be used internally.\n> >> \n> >> Signed-off-by: Peter Xu <peterx@redhat.com>\n> >> ---\n> >>  include/sysemu/iothread.h |  8 ++++++++\n> >>  iothread.c                | 21 +++++++++++++++++++++\n> >>  2 files changed, 29 insertions(+)\n> >> \n> >> diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h\n> >> index d2985b3..b07663f 100644\n> >> --- a/include/sysemu/iothread.h\n> >> +++ b/include/sysemu/iothread.h\n> >> @@ -46,4 +46,12 @@ AioContext *iothread_get_aio_context(IOThread *iothread);\n> >>  void iothread_stop_all(void);\n> >>  GMainContext *iothread_get_g_main_context(IOThread *iothread);\n> >>  \n> >> +/*\n> >> + * Helpers used to allocate iothreads for internal use.  These\n> >> + * iothreads will not be seen by monitor clients when query using\n> >> + * \"query-iothreads\".\n> >> + */\n> >> +IOThread *iothread_create(const char *id, Error **errp);\n> >> +void iothread_destroy(IOThread *iothread);\n> >> +\n> >>  #endif /* IOTHREAD_H */\n> >> diff --git a/iothread.c b/iothread.c\n> >> index 44c8944..74e400c 100644\n> >> --- a/iothread.c\n> >> +++ b/iothread.c\n> >> @@ -354,3 +354,24 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n> >>  \n> >>      return iothread->worker_context;\n> >>  }\n> >> +\n> >> +static Object *iothread_get_internal_parent(void)\n> >> +{\n> >> +    return container_get(object_get_root(), \"/internal-iothreads\");\n> >> +}\n> >\n> > Markus, please advise on the following QMP API design issue.\n> \n> Sorry for the slow response.  Is my advice still needed, or are you\n> good?\n\nI see that the patches are in master now (latest version, not this\none), and the consensus should be that internally used iothreads won't\naffect results of query-iothreads.  So I think we are good now.  Thanks,","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=peterx@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y936h6LTdz9t34\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun,  8 Oct 2017 23:47:05 +1100 (AEDT)","from localhost ([::1]:53672 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1e1Ayy-0000WR-KU\n\tfor incoming@patchwork.ozlabs.org; Sun, 08 Oct 2017 08:47:00 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:54094)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1e1AyW-0000WH-DA\n\tfor qemu-devel@nongnu.org; Sun, 08 Oct 2017 08:46:33 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1e1AyR-0004ba-HE\n\tfor qemu-devel@nongnu.org; Sun, 08 Oct 2017 08:46:32 -0400","from mx1.redhat.com ([209.132.183.28]:45082)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <peterx@redhat.com>) id 1e1AyR-0004b7-AH\n\tfor qemu-devel@nongnu.org; Sun, 08 Oct 2017 08:46:27 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 6709C4E4D0\n\tfor <qemu-devel@nongnu.org>; Sun,  8 Oct 2017 12:46:25 +0000 (UTC)","from pxdev.xzpeter.org (ovpn-12-35.pek2.redhat.com [10.72.12.35])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 0436C5C588;\n\tSun,  8 Oct 2017 12:46:17 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 6709C4E4D0","Date":"Sun, 8 Oct 2017 20:46:14 +0800","From":"Peter Xu <peterx@redhat.com>","To":"Markus Armbruster <armbru@redhat.com>","Message-ID":"<20171008124614.GA7792@pxdev.xzpeter.org>","References":"<1506070572-7549-1-git-send-email-peterx@redhat.com>\n\t<1506070572-7549-2-git-send-email-peterx@redhat.com>\n\t<20170922101652.GF9243@stefanha-x1.localdomain>\n\t<87h8vh1nar.fsf@dusky.pond.sub.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<87h8vh1nar.fsf@dusky.pond.sub.org>","User-Agent":"Mutt/1.5.24 (2015-08-30)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tSun, 08 Oct 2017 12:46:25 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] iothread: provide helpers for internal\n\tuse","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>,\n\tqemu-devel@nongnu.org, Stefan Hajnoczi <shajnocz@redhat.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]