aboutsummaryrefslogtreecommitdiff
path: root/include/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-04-08 18:26:37 +0200
committerKevin Wolf <kwolf@redhat.com>2016-05-25 19:04:21 +0200
commita1a2af075647bb61e1435ce4c78d99e3f36d928b (patch)
treef7278838924299de61dac499e820d7e18c0accce /include/block
parenta7112795c14d99b81600f8809fda5ce18b430830 (diff)
downloadqemu-a1a2af075647bb61e1435ce4c78d99e3f36d928b.zip
qemu-a1a2af075647bb61e1435ce4c78d99e3f36d928b.tar.gz
qemu-a1a2af075647bb61e1435ce4c78d99e3f36d928b.tar.bz2
block: Cancel jobs first in bdrv_close_all()
So far, bdrv_close_all() first removed all root BlockDriverStates of BlockBackends and monitor owned BDSes, and then assumed that the remaining BDSes must be related to jobs and cancelled these jobs. This order doesn't work that well any more when block jobs use BlockBackends internally because then they will lose their BDS before being cancelled. This patch changes bdrv_close_all() to first cancel all jobs and then remove all root BDSes from the remaining BBs. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/blockjob.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index 30bb2c6..4ac6831 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -371,6 +371,13 @@ bool block_job_is_paused(BlockJob *job);
int block_job_cancel_sync(BlockJob *job);
/**
+ * block_job_cancel_sync_all:
+ *
+ * Synchronously cancels all jobs using block_job_cancel_sync().
+ */
+void block_job_cancel_sync_all(void);
+
+/**
* block_job_complete_sync:
* @job: The job to be completed.
* @errp: Error object which may be set by block_job_complete(); this is not