From: Kevin Wolf <kwolf@redhat.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] avoid core reading with bdrv_read (qemu-io)
Date: Tue, 19 Jul 2011 09:52:05 +0200 [thread overview]
Message-ID: <4E2537A5.1080009@redhat.com> (raw)
In-Reply-To: <CAHt6W4ef8yfC=ymNi4smYXhLw5ur0jCW4iKQ0CkAPTyp=vn7ew@mail.gmail.com>
Am 19.07.2011 09:33, schrieb Frediano Ziglio:
> This patch apply to kevin coroutine-block branch and avoid code. It
> fix "qcow: Use coroutines" patch. Test case:
>
> $ ./qemu-img create -f qcow aaa.img 1G
> Formatting 'aaa.img', fmt=qcow size=1073741824 encryption=off
> $ ./qemu-io aaa.img
> qemu-io> read 1024 1024
> Segmentation fault
>
> Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Thanks for the report. I'll update the patch, but in a slightly
different way that matches the old code better:
diff --git a/block/qcow.c b/block/qcow.c
index 6f7973c..6447c2a 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -573,7 +573,6 @@ static int qcow_aio_read_cb(void *opaque)
if (acb->nb_sectors == 0) {
/* request completed */
- qemu_iovec_from_buffer(acb->qiov, acb->orig_buf, acb->qiov->size);
return 0;
}
@@ -647,6 +646,7 @@ static int qcow_co_readv(BlockDriverState *bs,
int64_t sector_num,
qemu_co_mutex_unlock(&s->lock);
if (acb->qiov->niov > 1) {
+ qemu_iovec_from_buffer(acb->qiov, acb->orig_buf, acb->qiov->size);
qemu_vfree(acb->orig_buf);
}
qemu_aio_release(acb);
next prev parent reply other threads:[~2011-07-19 7:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-19 7:33 [Qemu-devel] [PATCH] avoid core reading with bdrv_read (qemu-io) Frediano Ziglio
2011-07-19 7:52 ` Kevin Wolf [this message]
2011-07-19 8:22 ` Frediano Ziglio
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=4E2537A5.1080009@redhat.com \
--to=kwolf@redhat.com \
--cc=freddy77@gmail.com \
--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 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.