From: Stefan Hajnoczi <stefanha@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: kwolf@redhat.com, fujita.tomonori@lab.ntt.co.jp,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
Ronnie Sahlberg <ronniesahlberg@gmail.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] This patch adds a new block driver : iSCSI
Date: Wed, 14 Sep 2011 16:50:25 +0100 [thread overview]
Message-ID: <CAJSP0QW-o7fFF25YPY17EXqu_tJcD052aFvSnFKNi6eQsi0dZA@mail.gmail.com> (raw)
In-Reply-To: <20110914143608.GB12218@lst.de>
On Wed, Sep 14, 2011 at 3:36 PM, Christoph Hellwig <hch@lst.de> wrote:
> On Mon, Sep 12, 2011 at 10:14:08AM +0100, Stefan Hajnoczi wrote:
>> > +static void
>> > +iscsi_aio_cancel(BlockDriverAIOCB *blockacb)
>> > +{
>> > + IscsiAIOCB *acb = (IscsiAIOCB *)blockacb;
>> > + IscsiLun *iscsilun = acb->iscsilun;
>> > +
>> > + acb->status = -ECANCELED;
>> > + acb->common.cb(acb->common.opaque, acb->status);
>> > + acb->canceled = 1;
>> > +
>> > + iscsi_task_mgmt_abort_task_async(iscsilun->iscsi, acb->task,
>> > + iscsi_abort_task_cb, NULL);
>> > +}
>>
>> The asynchronous abort task call looks odd. If a caller allocates a
>> buffer and issues a read request, then we need to make sure that the
>> request is really aborted by the time .bdrv_aio_cancel() returns.
>
> Shouldn't new drivers use coroutines instead of aio instead?
>
> (just poking around, I don't fully understand the new scheme myself yet
> either)
I think in this case it will not make the code nicer. Since the
external iSCSI library is based on callbacks it would be necessary to
write the coroutines<->callbacks adapter functions. So for example,
the READ10 command would need a function that can be called in
coroutine context and yields while libiscsi does the I/O. When the
callback is invoked it will re-enter the coroutine.
The area where coroutines are useful in the block layer is for image
formats. We already have common coroutines<->callback adapter
functions in block.c so it's possible to write sequential code for
image formats. They only need access to block layer functions which
have already been adapted. But as soon as you interact with a
callback-based API from the coroutine, then you need to write an
adapter yourself.
Stefan
next prev parent reply other threads:[~2011-09-14 15:50 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-10 4:23 [Qemu-devel] [PATCH] Add iSCSI support for QEMU Ronnie Sahlberg
2011-09-10 4:23 ` [Qemu-devel] [PATCH] This patch adds a new block driver : iSCSI Ronnie Sahlberg
2011-09-12 9:14 ` Stefan Hajnoczi
2011-09-14 14:36 ` Christoph Hellwig
2011-09-14 15:50 ` Stefan Hajnoczi [this message]
2011-09-16 15:53 ` Christoph Hellwig
2011-09-17 7:11 ` Stefan Hajnoczi
2011-09-14 22:51 ` ronnie sahlberg
2011-09-15 8:02 ` Daniel P. Berrange
2011-09-15 9:03 ` Kevin Wolf
2011-09-14 23:08 ` ronnie sahlberg
2011-09-15 6:04 ` Paolo Bonzini
2011-09-15 8:48 ` Dor Laor
2011-09-15 9:11 ` Paolo Bonzini
2011-09-15 11:27 ` ronnie sahlberg
2011-09-15 11:42 ` Dor Laor
2011-09-15 11:46 ` Christoph Hellwig
2011-09-15 12:01 ` Dor Laor
2011-09-15 12:04 ` Paolo Bonzini
2011-09-15 11:58 ` Paolo Bonzini
2011-09-15 12:34 ` Orit Wasserman
2011-09-15 12:58 ` Paolo Bonzini
2011-09-15 16:59 ` Orit Wasserman
2011-09-15 9:44 ` Daniel P. Berrange
2011-09-15 9:10 ` Kevin Wolf
2011-09-15 9:39 ` Paolo Bonzini
2011-09-21 9:48 ` ronnie sahlberg
2011-09-23 9:15 ` Mark Wu
2011-09-23 10:16 ` Paolo Bonzini
2011-09-12 8:56 ` [Qemu-devel] [PATCH] Add iSCSI support for QEMU Kevin Wolf
2011-09-14 12:24 ` Orit Wasserman
2011-09-14 14:33 ` Christoph Hellwig
2011-09-14 14:37 ` Christoph Hellwig
2011-09-14 15:35 ` Stefan Hajnoczi
2011-09-14 15:40 ` Christoph Hellwig
2011-09-14 15:51 ` Stefan Hajnoczi
2011-09-14 16:36 ` Orit Wasserman
2011-09-15 6:06 ` Paolo Bonzini
2011-09-15 9:52 ` Orit Wasserman
2011-09-15 9:55 ` Paolo Bonzini
2011-09-15 10:10 ` Kevin Wolf
2011-09-17 19:08 ` Laurent Vivier
2011-09-18 7:43 ` Paolo Bonzini
2011-09-14 16:37 ` Paolo Bonzini
2011-09-14 22:46 ` ronnie sahlberg
-- strict thread matches above, loose matches on Subject: below --
2011-09-21 9:37 Ronnie Sahlberg
2011-09-21 9:37 ` [Qemu-devel] [PATCH] This patch adds a new block driver : iSCSI Ronnie Sahlberg
2011-09-21 9:45 ` Paolo Bonzini
2011-09-21 9:52 ` ronnie sahlberg
2011-09-27 20:08 ` ronnie sahlberg
2011-09-28 5:54 ` Paolo Bonzini
2011-09-29 6:54 ` Stefan Hajnoczi
2011-10-09 20:46 ` ronnie sahlberg
2011-10-13 9:46 ` ronnie sahlberg
2011-10-13 9:48 ` Paolo Bonzini
2011-10-13 9:54 ` Stefan Hajnoczi
2011-10-13 10:01 ` Daniel P. Berrange
2011-10-13 10:55 ` Daniel P. Berrange
2011-10-13 10:52 ` Kevin Wolf
2011-10-24 13:33 ` Kevin Wolf
2011-10-25 8:04 ` ronnie sahlberg
2011-10-25 8:17 ` Kevin Wolf
2011-10-25 8:23 ` ronnie sahlberg
2011-10-25 8:46 ` Kevin Wolf
2011-10-28 10:46 ` Zhi Yong Wu
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=CAJSP0QW-o7fFF25YPY17EXqu_tJcD052aFvSnFKNi6eQsi0dZA@mail.gmail.com \
--to=stefanha@gmail.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hch@lst.de \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=ronniesahlberg@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 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).