diff options
author | Max Reitz <mreitz@redhat.com> | 2016-01-29 16:36:14 +0100 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2016-02-02 17:50:46 +0100 |
commit | ca9bd24cf1d53775169ba9adc17e265554d1afed (patch) | |
tree | c8eda481f153bb8086cc2f59642564943efa136b /disas.c | |
parent | d8da3cef3bc649492d190e029343293df1386027 (diff) | |
download | qemu-ca9bd24cf1d53775169ba9adc17e265554d1afed.zip |
block: Rewrite bdrv_close_all()
This patch rewrites bdrv_close_all(): Until now, all root BDSs have been
force-closed. This is bad because it can lead to cached data not being
flushed to disk.
Instead, try to make all reference holders relinquish their reference
voluntarily:
1. All BlockBackend users are handled by making all BBs simply eject
their BDS tree. Since a BDS can never be on top of a BB, this will
not cause any of the issues as seen with the force-closing of BDSs.
The references will be relinquished and any further access to the BB
will fail gracefully.
2. All BDSs which are owned by the monitor itself (because they do not
have a BB) are relinquished next.
3. Besides BBs and the monitor, block jobs and other BDSs are the only
things left that can hold a reference to BDSs. After every remaining
block job has been canceled, there should not be any BDSs left (and
the loop added here will always terminate (as long as NDEBUG is not
defined), because either all_bdrv_states will be empty or there will
not be any block job left to cancel, failing the assertion).
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'disas.c')
0 files changed, 0 insertions, 0 deletions