]> git.proxmox.com Git - mirror_qemu.git/commit
block: Make bdrv_drain() use bdrv_drained_begin/end()
authorKevin Wolf <kwolf@redhat.com>
Mon, 23 May 2016 14:08:55 +0000 (16:08 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 25 May 2016 17:04:10 +0000 (19:04 +0200)
commit6820643fdbe0d4e2ab6a188dee4782c003a4bb68
treec98f38abcbfc45a5b96128222eb97d49469ff860
parente9740bc6d466df53efe4b8f797e99d16212799d0
block: Make bdrv_drain() use bdrv_drained_begin/end()

Until now, bdrv_drained_begin() used bdrv_drain() internally to drain
the queue. This is kind of backwards and caused quiescing code to be
duplicated because bdrv_drained_begin() had to ensure that no new
requests come in even after bdrv_drain() returns, whereas bdrv_drain()
had to have them because it could be called from other places.

Instead move the bdrv_drain() code to bdrv_drained_begin() and make
bdrv_drain() a simple wrapper around bdrv_drained_begin/end().

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
block/io.c