From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbPkn-0006A1-HX for qemu-devel@nongnu.org; Fri, 27 Mar 2015 04:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbPkg-0007E5-PO for qemu-devel@nongnu.org; Fri, 27 Mar 2015 04:36:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbPkg-0007Dx-IM for qemu-devel@nongnu.org; Fri, 27 Mar 2015 04:36:26 -0400 Date: Fri, 27 Mar 2015 16:35:41 +0800 From: Fam Zheng Message-ID: <20150327083541.GA3981@ad.nay.redhat.com> References: <20150326185250.GA23415@igalia.com> <20150327011119.GM14724@ad.nay.redhat.com> <20150327072350.GA21994@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150327072350.GA21994@igalia.com> Subject: Re: [Qemu-devel] [PATCH v4 0/7] Block Throttle Group Support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On Fri, 03/27 08:23, Alberto Garcia wrote: > On Fri, Mar 27, 2015 at 09:11:19AM +0800, Fam Zheng wrote: > > > > Hmm... this actually breaks the new test because now BDS are > > > required to have an AioContext attached when they're added to a > > > group, which doesn't happen in qtest: > > > > > > bdrv = bdrv_new(); > > > throttle_group_register_bs(bdrv, "bar"); > > > > > > I'm unsure of how to proceed with this, I don't see a clear way to > > > attach the AioContext here (unless I do bdrv->aio_context = ctx). > > > Suggestions are welcome. > > > > Use bdrv_attach_aio_context? > > That doesn't work in that case, bdrv_attach_aio_context() does nothing > if bdrv->drv is null. > > The test works fine if I set bdrv->aio_context directly as I said > above, but is it ok to do that? I think it should be OK as a test. Or assert(qtest_enabled()) in throttle_group_register_bs and assign the main loop AioContext, which is basically the same. Fam