mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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>
This commit is contained in:
parent
a7112795c1
commit
a1a2af0756
3 changed files with 22 additions and 21 deletions
|
@ -370,6 +370,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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue