]> git.ipfire.org Git - thirdparty/qemu.git/commit
block: fix bdrv_flush() ordering in bdrv_close()
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 2 Jul 2013 13:36:25 +0000 (15:36 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 12 Aug 2013 22:32:23 +0000 (17:32 -0500)
commitf8cd6dfdd8baa86d59fba02dfad67a1cb0d5e235
treecdfee819a169ec7fee709f164e1ecd9e50243609
parentb5bfb026e48f7f8427923b92d0de652728e6457c
block: fix bdrv_flush() ordering in bdrv_close()

Since 80ccf93b we flush the block device during close.  The
bdrv_drain_all() call should come before bdrv_flush() to ensure guest
write requests have completed.  Otherwise we may miss pending writes
when flushing.

Call bdrv_drain_all() again for safety as the final step after
bdrv_flush().  This should not be necessary but we can be paranoid here
in case bdrv_flush() left I/O pending.

Cc: qemu-stable@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 58fda173e1156d24e5ff62361774715152188a07)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block.c