summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-06-02 18:55:17 +0200
committerKevin Wolf <kwolf@redhat.com>2010-06-15 09:41:59 +0200
commit049f306f99e83680b3da11bf0e1a1da63cb2036d (patch)
tree0bb8f33deaa33cc945b69ef7ba549b07babacb06 /block.c
parented06b81ab1802d0c25d314dd29deb638325e32bc (diff)
downloadqemu-049f306f99e83680b3da11bf0e1a1da63cb2036d.tar.gz
qemu-049f306f99e83680b3da11bf0e1a1da63cb2036d.tar.bz2
qemu-049f306f99e83680b3da11bf0e1a1da63cb2036d.zip
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>
Diffstat (limited to 'block.c')
-rw-r--r--block.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/block.c b/block.c
index 29a6f393df..e701ec0372 100644
--- a/block.c
+++ b/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;