mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-27 13:30:52 +00:00
block: Remove bdrv_(set_)enable_write_cache()
The only remaining users were block jobs (mirror and backup) which unconditionally enabled WCE on the BlockBackend of the target image. As these block jobs don't go through BlockBackend for their I/O requests, they aren't affected by this setting anyway but always get a writeback mode, so that call can be removed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
61de4c6808
commit
09cf9db1bc
16
block.c
16
block.c
@ -2695,22 +2695,6 @@ int bdrv_is_sg(BlockDriverState *bs)
|
|||||||
return bs->sg;
|
return bs->sg;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bdrv_enable_write_cache(BlockDriverState *bs)
|
|
||||||
{
|
|
||||||
if (bs->blk) {
|
|
||||||
return blk_enable_write_cache(bs->blk);
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void bdrv_set_enable_write_cache(BlockDriverState *bs, bool wce)
|
|
||||||
{
|
|
||||||
if (bs->blk) {
|
|
||||||
blk_set_enable_write_cache(bs->blk, wce);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int bdrv_is_encrypted(BlockDriverState *bs)
|
int bdrv_is_encrypted(BlockDriverState *bs)
|
||||||
{
|
{
|
||||||
if (bs->backing && bs->backing->bs->encrypted) {
|
if (bs->backing && bs->backing->bs->encrypted) {
|
||||||
|
@ -404,7 +404,6 @@ static void coroutine_fn backup_run(void *opaque)
|
|||||||
|
|
||||||
job->done_bitmap = bitmap_new(end);
|
job->done_bitmap = bitmap_new(end);
|
||||||
|
|
||||||
bdrv_set_enable_write_cache(target, true);
|
|
||||||
if (target->blk) {
|
if (target->blk) {
|
||||||
blk_set_on_error(target->blk, on_target_error, on_target_error);
|
blk_set_on_error(target->blk, on_target_error, on_target_error);
|
||||||
blk_iostatus_enable(target->blk);
|
blk_iostatus_enable(target->blk);
|
||||||
|
@ -856,7 +856,6 @@ static void mirror_start_job(BlockDriverState *bs, BlockDriverState *target,
|
|||||||
|
|
||||||
bdrv_op_block_all(s->target, s->common.blocker);
|
bdrv_op_block_all(s->target, s->common.blocker);
|
||||||
|
|
||||||
bdrv_set_enable_write_cache(s->target, true);
|
|
||||||
if (s->target->blk) {
|
if (s->target->blk) {
|
||||||
blk_set_on_error(s->target->blk, on_target_error, on_target_error);
|
blk_set_on_error(s->target->blk, on_target_error, on_target_error);
|
||||||
blk_iostatus_enable(s->target->blk);
|
blk_iostatus_enable(s->target->blk);
|
||||||
|
@ -395,8 +395,6 @@ int bdrv_is_allocated_above(BlockDriverState *top, BlockDriverState *base,
|
|||||||
|
|
||||||
int bdrv_is_read_only(BlockDriverState *bs);
|
int bdrv_is_read_only(BlockDriverState *bs);
|
||||||
int bdrv_is_sg(BlockDriverState *bs);
|
int bdrv_is_sg(BlockDriverState *bs);
|
||||||
int bdrv_enable_write_cache(BlockDriverState *bs);
|
|
||||||
void bdrv_set_enable_write_cache(BlockDriverState *bs, bool wce);
|
|
||||||
bool bdrv_is_inserted(BlockDriverState *bs);
|
bool bdrv_is_inserted(BlockDriverState *bs);
|
||||||
int bdrv_media_changed(BlockDriverState *bs);
|
int bdrv_media_changed(BlockDriverState *bs);
|
||||||
void bdrv_lock_medium(BlockDriverState *bs, bool locked);
|
void bdrv_lock_medium(BlockDriverState *bs, bool locked);
|
||||||
|
Loading…
Reference in New Issue
Block a user