qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Ryan Harper <ryanh@us.ibm.com>
Cc: 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:34:55 -0500	[thread overview]
Message-ID: <48D8FE8F.9000702@us.ibm.com> (raw)
In-Reply-To: <20080923142622.GJ31395@us.ibm.com>

Ryan Harper wrote:
> * 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().
>   

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.

Regards,

Anthony Liguori

  reply	other threads:[~2008-09-23 14:36 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
2008-09-23 14:34       ` Anthony Liguori [this message]
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=48D8FE8F.9000702@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ryanh@us.ibm.com \
    /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).