From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDHKY-0004Hl-4t for qemu-devel@nongnu.org; Wed, 06 Mar 2013 11:36:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDHKR-00007s-UG for qemu-devel@nongnu.org; Wed, 06 Mar 2013 11:36:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDHKR-00007E-Kk for qemu-devel@nongnu.org; Wed, 06 Mar 2013 11:36:31 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r26GaU8l023210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Mar 2013 11:36:31 -0500 Message-ID: <5137708C.8070905@redhat.com> Date: Wed, 06 Mar 2013 17:36:28 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1362584735-30911-1-git-send-email-stefanha@redhat.com> <1362584735-30911-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1362584735-30911-3-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/5] threadpool: add thread_pool_new() and thread_pool_free() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-devel@nongnu.org Il 06/03/2013 16:45, Stefan Hajnoczi ha scritto: > + if (pool->ctx) { > + aio_set_event_notifier(pool->ctx, &pool->notifier, NULL, NULL); > + } else { > + qemu_aio_set_event_notifier(&pool->notifier, NULL, NULL); > + } I have the same complaint about ->ctx here. I think it's nicer to pick the right context in the creation function rather than every time you use pool->ctx (allowing to pass in NULL is fine). Also, when you drop the global ThreadPool each pool is guaranteed to have an AioContext and the special casing can be dropped completely. Paolo