* Anthony Liguori <[EMAIL PROTECTED]> [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 <[EMAIL PROTECTED]>
> >
> >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
[EMAIL PROTECTED]
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to