From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ki95t-00007x-DQ for qemu-devel@nongnu.org; Tue, 23 Sep 2008 10:42:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ki95r-00006m-Vw for qemu-devel@nongnu.org; Tue, 23 Sep 2008 10:42:25 -0400 Received: from [199.232.76.173] (port=47784 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ki95r-00006Z-HI for qemu-devel@nongnu.org; Tue, 23 Sep 2008 10:42:23 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:55028) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ki95q-0000vN-Py for qemu-devel@nongnu.org; Tue, 23 Sep 2008 10:42:23 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e32.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m8NEYJlN027063 for ; Tue, 23 Sep 2008 10:34:19 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m8NEg6Ir136164 for ; Tue, 23 Sep 2008 08:42:10 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m8NEfsJq022107 for ; Tue, 23 Sep 2008 08:41:54 -0600 Date: Tue, 23 Sep 2008 09:41:52 -0500 From: Ryan Harper Subject: Re: [Qemu-devel] Re: [PATCH 1/3] Only call aio flush handler if set Message-ID: <20080923144152.GL31395@us.ibm.com> References: <1222125454-21744-1-git-send-email-ryanh@us.ibm.com> <1222125454-21744-2-git-send-email-ryanh@us.ibm.com> <48D8568F.2060206@us.ibm.com> <20080923142622.GJ31395@us.ibm.com> <48D8FE8F.9000702@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48D8FE8F.9000702@us.ibm.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Ryan Harper , qemu-devel@nongnu.org, kvm@vger.kernel.org * Anthony Liguori [2008-09-23 09:36]: > Ryan Harper wrote: > >* Anthony Liguori [2008-09-22 21:49]: > > > >>Ryan Harper wrote: > >> > >>>If the aio handler doesn't register an io_flush handler, we'd SEGV; fix > >>>that by > >>>only calling the flush handler if set. BTW, aio handlers *should* > >>>register an > >>>io_flush routine. > >>> > >>>Signed-off-by: Ryan Harper > >>> > >>>diff --git a/aio.c b/aio.c > >>>index 687e4be..2bb3ed4 100644 > >>>--- a/aio.c > >>>+++ b/aio.c > >>>@@ -105,7 +105,8 @@ void qemu_aio_flush(void) > >>> ret = 0; > >>> > >>> LIST_FOREACH(node, &aio_handlers, node) { > >>>- ret |= node->io_flush(node->opaque); > >>>+ if (node->io_flush) > >>>+ ret |= node->io_flush(node->opaque); > >>> } > >>> > >>> > >>Just not doing an io_flush is just hiding the real bug--that the user > >>didn't register an io_flush handler. If the inevitable SEGV is not your > >> > > > >That may be true, but it it is no different than the check for read and > >write handlers in qemu_aio_wait(). > > > > Read and write handlers are optional. I guess in practice one or the > other should be set but neither one is individually required. The > problem with your patch is that it takes something that is a bug, and > makes it more difficult to spot. So it actually makes things worse. I disagree that anything is worse off by not SEGV'ing, In any case, what do you want here? Read or Write must be set along with flush or we error in fd registration? -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com