[{"id":1775155,"web_url":"http://patchwork.ozlabs.org/comment/1775155/","msgid":"<20170926045917.GD31924@lemon.lan>","list_archive_url":null,"date":"2017-09-26T04:59:17","subject":"Re: [Qemu-devel] [PATCH v3 2/4] iothread: provide helpers for\n\tinternal use","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Tue, 09/26 12:52, 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> Put all the internal used iothreads into the internal object container.\n> \n> Signed-off-by: Peter Xu <peterx@redhat.com>\n> ---\n>  include/sysemu/iothread.h |  8 ++++++++\n>  iothread.c                | 16 ++++++++++++++++\n>  2 files changed, 24 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..33f996e 100644\n> --- a/iothread.c\n> +++ b/iothread.c\n> @@ -354,3 +354,19 @@ GMainContext *iothread_get_g_main_context(IOThread *iothread)\n>  \n>      return iothread->worker_context;\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> +                                object_get_internal_root(),\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> \n\nReviewed-by: Fam Zheng <famz@redhat.com>","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 3y1TK672Kwz9t2M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 14:59:54 +1000 (AEST)","from localhost ([::1]:45634 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 1dwhyL-0006kB-5h\n\tfor incoming@patchwork.ozlabs.org; Tue, 26 Sep 2017 00:59:53 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:51567)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dwhxv-0006h9-0M\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 00:59:30 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dwhxu-0003Mg-8F\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 00:59:27 -0400","from mx1.redhat.com ([209.132.183.28]:48628)\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 1dwhxu-0003M6-2S\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 00:59:26 -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 0EA5C80469;\n\tTue, 26 Sep 2017 04:59:25 +0000 (UTC)","from localhost (ovpn-12-91.pek2.redhat.com [10.72.12.91])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 2EA1D62466;\n\tTue, 26 Sep 2017 04:59:22 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 0EA5C80469","Date":"Tue, 26 Sep 2017 12:59:17 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Peter Xu <peterx@redhat.com>","Message-ID":"<20170926045917.GD31924@lemon.lan>","References":"<1506401532-25274-1-git-send-email-peterx@redhat.com>\n\t<1506401532-25274-3-git-send-email-peterx@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1506401532-25274-3-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.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tTue, 26 Sep 2017 04:59: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 v3 2/4] iothread: provide helpers for\n\tinternal use","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":"Manos Pitsidianakis <el13635@mail.ntua.gr>, qemu-devel@nongnu.org, \"Dr .\n\tDavid Alan Gilbert\" <dgilbert@redhat.com>, Stefan Hajnoczi\n\t<shajnocz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Andreas\n\t=?iso-8859-1?q?F=E4rber?= <afaerber@suse.de>","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":1775269,"web_url":"http://patchwork.ozlabs.org/comment/1775269/","msgid":"<20170926084649.GD16834@stefanha-x1.localdomain>","list_archive_url":null,"date":"2017-09-26T08:46:49","subject":"Re: [Qemu-devel] [PATCH v3 2/4] iothread: provide helpers for\n\tinternal use","submitter":{"id":2747,"url":"http://patchwork.ozlabs.org/api/people/2747/","name":"Stefan Hajnoczi","email":"stefanha@gmail.com"},"content":"On Tue, Sep 26, 2017 at 12:52: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> Put all the internal used iothreads into the internal object container.\n> \n> Signed-off-by: Peter Xu <peterx@redhat.com>\n> ---\n>  include/sysemu/iothread.h |  8 ++++++++\n>  iothread.c                | 16 ++++++++++++++++\n>  2 files changed, 24 insertions(+)\n\nReviewed-by: Stefan Hajnoczi <stefanha@redhat.com>","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"kSs4OJdz\"; dkim-atps=neutral"],"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 3y1ZNK48ylz9tXK\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 18:48:01 +1000 (AEST)","from localhost ([::1]:46219 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 1dwlX5-0001UM-Mr\n\tfor incoming@patchwork.ozlabs.org; Tue, 26 Sep 2017 04:47:59 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:46313)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <stefanha@gmail.com>) id 1dwlW3-00017X-0K\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 04:46:56 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <stefanha@gmail.com>) id 1dwlVz-0004CZ-T6\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 04:46:55 -0400","from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:35844)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <stefanha@gmail.com>) id 1dwlVz-0004CM-MY\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 04:46:51 -0400","by mail-wr0-x243.google.com with SMTP id g50so1896288wra.3\n\tfor <qemu-devel@nongnu.org>; Tue, 26 Sep 2017 01:46:51 -0700 (PDT)","from localhost ([51.15.41.238]) by smtp.gmail.com with ESMTPSA id\n\tb28sm1872597wmi.46.2017.09.26.01.46.49\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tTue, 26 Sep 2017 01:46:49 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=zQhylgSp0S0qrZTXSeK71NVtNtQ7OkZPdCkJsLlNh0c=;\n\tb=kSs4OJdzULm87bUZc2j7tebJ9X0WjCXjbRvwwHs4JirTUfu6+Af+peEWUW2WN6CYC1\n\thyD01a3q0UY+QZhfrU9XTXLk+UCYawbFgJQO9Id978aP44I/aMhOBYcv8DAODCcPh9gD\n\tWbSymTTyKMwqgI96cw7tSDzWs1/Jgpe/QwSYpsxZoRRf286WxdlWctmjsvbdsrUEEvjN\n\t5/ZiZTVddoyZm/Ncp76Zi2iYF/viSndPeXMLq9Ay/Fu5GFUO1hNk5AZBg+1jsVfTdEpV\n\tdfReaX/RuXaV297FC/pWbLv1oBUwhiMlkSlqUXkCm0vUDfvJpF6sYimEx6jTyBp/A38g\n\tQw3g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=zQhylgSp0S0qrZTXSeK71NVtNtQ7OkZPdCkJsLlNh0c=;\n\tb=buvpgcVQyExn/+6uQVu6p2Wmb2ab9mxfAhfrVRruNvzODkGxsJnZkyoW6heoTMt9lW\n\tBmPTO+GtzYPxiAyACAv/9XERnjFEcezlD41uKOIb3S2NEHi/wH53NS/b1odTlBiWGT+D\n\tl/Ul0F6iy521Bf6y8zTR9xkl2BloUUQvTq1/gDC+RVv2QmGz5hoYQhcf5FSzThmh6Wrd\n\taO01ux0ogO7Iyb25JmLo0RksAziM/fzueZIbMKaVBnuzCvKNaEhkeaqLitJOlsR2Dasq\n\tWcy+mgvfBWfKd7OjdrMk/9vFrc7i2AZJ5AUqsiQtcXvxSnksO3m05oSKGAQrPJ8vGFmz\n\tOSvQ==","X-Gm-Message-State":"AHPjjUiDqXw9fZd1/EDn4N8Tp196YK+Nh/iJSpDhwJwFxyEEi9xXopV4\n\txq5XNengX2EWevVMHSNamMj9ZKuB","X-Google-Smtp-Source":"AOwi7QDL8VjMwvgG+UzeTFg3qCQhg79Hwt/RrJ68jGdFfLp1yNu6pM3QG7MCzM470kAjkzPhdJBTWw==","X-Received":"by 10.223.160.170 with SMTP id m39mr451530wrm.174.1506415610646; \n\tTue, 26 Sep 2017 01:46:50 -0700 (PDT)","Date":"Tue, 26 Sep 2017 09:46:49 +0100","From":"Stefan Hajnoczi <stefanha@gmail.com>","To":"Peter Xu <peterx@redhat.com>","Message-ID":"<20170926084649.GD16834@stefanha-x1.localdomain>","References":"<1506401532-25274-1-git-send-email-peterx@redhat.com>\n\t<1506401532-25274-3-git-send-email-peterx@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1506401532-25274-3-git-send-email-peterx@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c0c::243","Subject":"Re: [Qemu-devel] [PATCH v3 2/4] iothread: provide helpers for\n\tinternal use","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>, Manos Pitsidianakis <el13635@mail.ntua.gr>, \n\tqemu-devel@nongnu.org, \"Dr . David Alan Gilbert\" <dgilbert@redhat.com>,\n\tStefan Hajnoczi <shajnocz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>,\n\tAndreas =?iso-8859-1?q?F=E4rber?= <afaerber@suse.de>","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>"}}]