From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [PATCH v3] blkverify: Add block driver for verifying I/O
Date: Mon, 20 Sep 2010 17:43:11 +0200 [thread overview]
Message-ID: <4C97810F.8020106@redhat.com> (raw)
In-Reply-To: <AANLkTimPfSv1QCDQTfnhMvy_usMzMDHDjUa59=fG7uR2@mail.gmail.com>
Am 20.09.2010 17:22, schrieb Stefan Hajnoczi:
> Thanks for your comments Kevin!
>
> I'd like to merge the overlapping I/O patch I sent today since
> blkverify is not in mainline yet. Are you okay with that or should I
> keep them separate?
If that works better for you, I don't mind merging them.
> On Mon, Sep 20, 2010 at 3:48 PM, Kevin Wolf <kwolf@redhat.com> wrote:
>> Am 04.09.2010 17:34, schrieb Stefan Hajnoczi:
>>> +static void blkverify_aio_cancel(BlockDriverAIOCB *acb)
>>> +{
>>> + bool done = false;
>>> +
>>> + /* Allow the request to complete so the raw file and test file stay in
>>> + * sync. Hijack the callback (since the request is cancelled anyway) to
>>> + * wait for completion.
>>> + */
>>
>> The approach of completing the request sounds okay, but I think you need
>> to call the original callback if you let it complete.
>
> Neither posix-aio-compat.c nor block/qcow2.c invoke the callback. Am
> I missing something?
qcow2 calls raw, so it doesn't need to do it itself.
posix-aio-compat invokes the callback indirectly by waiting for the
request to complete using the normal path.
>>> + acb->cb = blkverify_aio_cancel_cb;
>>> + acb->opaque = &done;
>>> + while (!done) {
>>> + qemu_aio_wait();
>>> + }
>>
>> qemu_aio_release(acb)?
>
> Will fix.
>
>>> + /* Open the test file */
>>> + s->test_file = bdrv_new("");
>>> + ret = bdrv_open(s->test_file, filename, flags, NULL);
>>> + if (ret < 0) {
>>> + return ret;
>>
>> This leaks bs->file.
>
> s->test_file needs bdrv_delete(). block.c:bdrv_open_common() calls
> bdrv_delete(bs->file) on failure to close and delete bs->file, but we
> don't need to rely on that. I will fix both.
Right, I missed that we're in the same path as with an automatically
allocated bs->file. Not exactly intuitive that the common implementation
cleans up when it didn't create the file. ;-)
Kevin
prev parent reply other threads:[~2010-09-20 15:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-04 15:30 [Qemu-devel] [PATCH v3] blkverify: Add block driver for verifying I/O Stefan Hajnoczi
2010-09-04 15:34 ` Stefan Hajnoczi
2010-09-20 14:48 ` [Qemu-devel] " Kevin Wolf
2010-09-20 15:22 ` Stefan Hajnoczi
2010-09-20 15:43 ` Kevin Wolf [this message]
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=4C97810F.8020106@redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@linux.vnet.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.