block: update bdrv_drain_all()/bdrv_drain() comments
commit7a63f3cdc44230109c91cdc0ee912c3cc7837141
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 2 Jul 2015 16:24:41 +0000 (2 17:24 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 7 Jul 2015 09:31:08 +0000 (7 10:31 +0100)
treea3e657a8da31f34aae5afe6e8b92cc186361784f
parent1bd84ee717bf146c19281cce48a36a2f4d71748d
block: update bdrv_drain_all()/bdrv_drain() comments

The doc comments for bdrv_drain_all() and bdrv_drain() are outdated:

 * The bdrv_drain() comment is a poor man's bdrv_lock()/bdrv_unlock()
   which Fam Zheng is currently developing.  Unfortunately this warning
   was never really enough because devices keep submitting I/O and op
   blockers don't prevent that.

 * The bdrv_drain_all() comment is still partially correct but reflects
   the nature of the implementation rather than API documentation.

Do make it clear that bdrv_drain() is only appropriate within an
AioContext.  For anything spanning AioContexts you need
bdrv_drain_all().

Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1435854281-6078-1-git-send-email-stefanha@redhat.com
block/io.c