Il 21/06/2013 13:07, Kevin Wolf ha scritto:
>>> > > Note that you're blocking here. The preferred way would be something
>>> > > involving a yield from the coroutine and a reenter as soon as all
>>> > > requests are done. Maybe a CoRwLock does what you need?
>> > Is there a document how to use it? Or can you help here?
> The idea would be to take a read lock while any request is in flight
> (i.e. qemu_co_rwlock_rdlock() before it's started and
> qemu_co_rwlock_unlock() when it completes), and to take a write lock
> (qemu_co_rwlock_wrlock) for the part of iscsi_co_is_allocated() that
> requires that no other request runs in parallel.
> 

You can just send the SCSI command asynchronously and wait for the
result.  There is an example in block/qed.c, the same would apply for iscsi.

Paolo

Reply via email to