From: Fam Zheng <famz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine
Date: Fri, 18 Dec 2015 09:17:16 +0800 [thread overview]
Message-ID: <20151218011716.GE25529@ad.usersys.redhat.com> (raw)
In-Reply-To: <5672AFDE.3030207@redhat.com>
On Thu, 12/17 13:51, Paolo Bonzini wrote:
>
>
> On 17/12/2015 13:33, Fam Zheng wrote:
> > > In the coroutine case, the yield is hidden in the drivers, and it may or
> > > may not happen. For example, qcow2_co_flush_to_os starts with
> > >
> > > qemu_co_mutex_lock(&s->lock);
> > >
> > > which can yield.
> >
> > bdrv_ioctl, on the contrary, is emulated with .bdrv_aio_ioctl, so it always
> > yields (unless -ENOTSUP), that's why I think aio_poll() is necessary in both
> > branches.
>
> But why should it yield, if called in coroutine context? bdrv_flush
> doesn't yield if emulated with .bdrv_aio_flush *and* called in coroutine
> context. bdrv_ioctl should do the same, I think.
>
Looking at bdrv_flush again I see what you mean. Thanks for explaining!
Reviewed-by: Fam Zheng <famz@redhat.com>
next prev parent reply other threads:[~2015-12-18 1:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 18:33 [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine Paolo Bonzini
2015-12-17 0:59 ` Fam Zheng
2015-12-17 8:44 ` Paolo Bonzini
2015-12-17 12:33 ` Fam Zheng
2015-12-17 12:51 ` Paolo Bonzini
2015-12-18 1:17 ` Fam Zheng [this message]
2015-12-18 12:16 ` Kevin Wolf
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=20151218011716.GE25529@ad.usersys.redhat.com \
--to=famz@redhat.com \
--cc=pbonzini@redhat.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 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).