mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
block: Move error actions from DriveInfo to BlockDriverState
That's where they belong semantically (block device host part), even though the actions are actually executed by guest device code. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
2063392ae5
commit
abd7f68d08
8 changed files with 26 additions and 29 deletions
12
block.c
12
block.c
|
@ -1206,6 +1206,18 @@ int bdrv_get_translation_hint(BlockDriverState *bs)
|
|||
return bs->translation;
|
||||
}
|
||||
|
||||
void bdrv_set_on_error(BlockDriverState *bs, BlockErrorAction on_read_error,
|
||||
BlockErrorAction on_write_error)
|
||||
{
|
||||
bs->on_read_error = on_read_error;
|
||||
bs->on_write_error = on_write_error;
|
||||
}
|
||||
|
||||
BlockErrorAction bdrv_get_on_error(BlockDriverState *bs, int is_read)
|
||||
{
|
||||
return is_read ? bs->on_read_error : bs->on_write_error;
|
||||
}
|
||||
|
||||
int bdrv_is_removable(BlockDriverState *bs)
|
||||
{
|
||||
return bs->removable;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue