diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-10-19 11:36:48 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-10-23 22:39:32 +0200 |
commit | 3cbc002c34aa85ea952ee9b169a3ff97d350516a (patch) | |
tree | 315dcce972e74ad3e8bab06550c1cfbddf376943 | |
parent | 101f9cbc2b73340197ec610c095fd69f0b1413ed (diff) | |
download | qemu-3cbc002c34aa85ea952ee9b169a3ff97d350516a.zip qemu-3cbc002c34aa85ea952ee9b169a3ff97d350516a.tar.gz qemu-3cbc002c34aa85ea952ee9b169a3ff97d350516a.tar.bz2 |
block: prepare code for adding block notifiers
There is no reason in principle to skip job cancellation and draining
of pending I/O when there is no medium in the disk. Do these unconditionally,
which also prepares the code for the next patch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | block.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1098,12 +1098,12 @@ void bdrv_reopen_abort(BDRVReopenState *reopen_state) void bdrv_close(BlockDriverState *bs) { bdrv_flush(bs); - if (bs->drv) { - if (bs->job) { - block_job_cancel_sync(bs->job); - } - bdrv_drain_all(); + if (bs->job) { + block_job_cancel_sync(bs->job); + } + bdrv_drain_all(); + if (bs->drv) { if (bs == bs_snapshots) { bs_snapshots = NULL; } |