qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Ryan Harper <ryanh@us.ibm.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] Re: [PATCH 1/3] Only call aio flush handler if set
Date: Tue, 23 Sep 2008 09:26:22 -0500	[thread overview]
Message-ID: <20080923142622.GJ31395@us.ibm.com> (raw)
In-Reply-To: <48D8568F.2060206@us.ibm.com>

* Anthony Liguori <aliguori@us.ibm.com> [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 <ryanh@us.ibm.com>
> >
> >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().

> thing, I'd rather see a check added to qemu_aio_set_fd_handler() that 
> threw an error and exited if called without an io_flush handler.

I'm not sure that is useful since it isn't always obvious whether or not
an aio handler needs to register all of the functions, read, write and
flush.

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
ryanh@us.ibm.com

  reply	other threads:[~2008-09-23 14:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 23:17 [Qemu-devel] [PATCH 0/3] Refactor AIO to allow multiple AIO implementations Ryan Harper
2008-09-22 23:17 ` [Qemu-devel] [PATCH 1/3] Only call aio flush handler if set Ryan Harper
2008-09-23  2:38   ` [Qemu-devel] " Anthony Liguori
2008-09-23 14:26     ` Ryan Harper [this message]
2008-09-23 14:34       ` Anthony Liguori
2008-09-23 14:41         ` Ryan Harper
2008-09-23 14:50           ` Anthony Liguori
2008-09-22 23:17 ` [Qemu-devel] [PATCH 2/3] Move aio implementation out of raw block driver Ryan Harper
2008-09-23  1:16   ` [Qemu-devel] " Ryan Harper
2008-09-23  2:45   ` Anthony Liguori
2008-09-23 14:39     ` Ryan Harper
2008-09-23 14:40       ` Anthony Liguori
2008-09-23 14:53       ` Gerd Hoffmann
2008-09-23 16:06         ` Anthony Liguori
2008-09-23 18:04           ` Gerd Hoffmann
2008-09-23 18:28             ` Anthony Liguori
2008-09-24 22:31     ` Marcelo Tosatti
2008-09-22 23:17 ` [Qemu-devel] " Ryan Harper
2008-09-23  1:22   ` [Qemu-devel] [PATCH 3/3] Add linux aio implementation for raw block devices Ryan Harper
2008-09-23  3:32 ` [Qemu-devel] Re: [PATCH 0/3] Refactor AIO to allow multiple AIO implementations Anthony Liguori
2008-09-23 14:43   ` Ryan Harper
2008-09-23 14:47     ` Anthony Liguori
2008-09-23 16:09     ` Anthony Liguori
2008-09-23 10:27 ` [Qemu-devel] " Jamie Lokier
2008-10-02 22:41 ` [Qemu-devel] " john cooper
2008-10-03 13:33   ` Ryan Harper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080923142622.GJ31395@us.ibm.com \
    --to=ryanh@us.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).