From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=59749 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PN0PW-0000R3-En for qemu-devel@nongnu.org; Mon, 29 Nov 2010 04:52:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PN0PU-0007Ux-Ht for qemu-devel@nongnu.org; Mon, 29 Nov 2010 04:52:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PN0PU-0007Uj-Az for qemu-devel@nongnu.org; Mon, 29 Nov 2010 04:52:36 -0500 Message-ID: <4CF377FA.7020607@redhat.com> Date: Mon, 29 Nov 2010 10:52:58 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 13/21] dma-helpers: replace bdrv_aio_writev() with bdrv_aio_writev_proxy(). References: <1290665220-26478-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> <1290665220-26478-14-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> <20101128093357.GC3342@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yoshiaki Tamura Cc: ohmura.kei@lab.ntt.co.jp, mtosatti@redhat.com, ananth@in.ibm.com, kvm@vger.kernel.org, "Michael S. Tsirkin" , dlaor@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, avi@redhat.com, vatsa@linux.vnet.ibm.com, psuriset@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com Am 28.11.2010 12:55, schrieb Yoshiaki Tamura: > 2010/11/28 Michael S. Tsirkin : >> On Thu, Nov 25, 2010 at 03:06:52PM +0900, Yoshiaki Tamura wrote: >>> Replace bdrv_aio_writev() with bdrv_aio_writev_proxy() to let >>> event-tap capture events from dma-helpers. >>> >>> Signed-off-by: Yoshiaki Tamura >> >> Same comment as -net here: it's not clear when should >> a device use bdrv_aio_writev_proxy and when bdrv_aio_writev. >> If all devices should just use _proxy, let's >> just make bdrv_aio_writev DTRT instead. > > Same as I replied to the net layer question. However, I had > troubles with inserting event-tap functions into block.c before. > block.c gets linked with utils like qemu-img, but they don't get > linked with emulators code which event-tap uses in it. So I want > to avoid linking block and event-tap for utils, but I guess we > don't want to use ifdefs for this. I'm wondering how I can solve > this problem cleanly. > > Kevin, do you have suggestions here? Michael's stubs (probably in qemu-tool.c) seem to be the right solution. Which requests do you actually want to intercept? I assume you're aware that for example qcow2 internally calls another bdrv_aio_readv/writev that accesses the image file. So if you only want to have the requests that come directly from devices, maybe you'll have to restrict it to BlockDriverStates that belongs to a drive. I think this is the case if it has a non-empty device name. Kevin