aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-07-19 14:59:13 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-07-19 14:59:13 +0100
commit4a10982c320740d2d0565180d901a69b043dc282 (patch)
treefd0b6faa8052913ff855ade033d286efb7b6d480 /vl.c
parente2b47666fe1544959c89bd3ed159e9e37cc9fc73 (diff)
parent49278ec065da3fbf90f7effcde3b39ac606b2e9e (diff)
downloadqemu-4a10982c320740d2d0565180d901a69b043dc282.zip
qemu-4a10982c320740d2d0565180d901a69b043dc282.tar.gz
qemu-4a10982c320740d2d0565180d901a69b043dc282.tar.bz2
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches: - block: Fix forbidden use of polling in drained_end - block: Don't wait for I/O throttling while exiting QEMU - iotests: Use read-zeroes for the null driver to be Valgrind-friendly # gpg: Signature made Fri 19 Jul 2019 14:30:14 BST # gpg: using RSA key 7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full] # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: iotests: Test quitting with job on throttled node vl: Drain before (block) job cancel when quitting iotests: Test commit with a filter on the chain iotests: Add @has_quit to vm.shutdown() block: Loop unsafely in bdrv*drained_end() tests: Extend commit by drained_end test block: Do not poll in bdrv_do_drained_end() tests: Lock AioContexts in test-block-iothread block: Make bdrv_parent_drained_[^_]*() static block: Add @drained_end_counter tests: Add job commit by drained_end test block: Introduce BdrvChild.parent_quiesce_counter iotests: Set read-zeroes on in null block driver for Valgrind Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index a5808f9..53335a5 100644
--- a/vl.c
+++ b/vl.c
@@ -4480,6 +4480,17 @@ int main(int argc, char **argv, char **envp)
*/
migration_shutdown();
+ /*
+ * We must cancel all block jobs while the block layer is drained,
+ * or cancelling will be affected by throttling and thus may block
+ * for an extended period of time.
+ * vm_shutdown() will bdrv_drain_all(), so we may as well include
+ * it in the drained section.
+ * We do not need to end this section, because we do not want any
+ * requests happening from here on anyway.
+ */
+ bdrv_drain_all_begin();
+
/* No more vcpu or device emulation activity beyond this point */
vm_shutdown();