summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-10-14 17:11:23 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2011-10-27 11:48:47 -0200
commitd6bf279e7a949ad49a48a215f9ec28cb6ceb28aa (patch)
tree1dd1a3912113b2a12aa0bf295df8404c334627e8 /block.c
parentde0b36b67ea3e1ab3aa1b6625c4fd5cb29fa0ada (diff)
downloadqemu-d6bf279e7a949ad49a48a215f9ec28cb6ceb28aa.tar.gz
block: iostatus: Drop BDRV_IOS_INVAL
A future commit will convert bdrv_info() to the QAPI and it won't provide IOS_INVAL. Luckily all we have to do is to add a new 'iostatus_enabled' member to BlockDriverState and use it instead. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block.c b/block.c
index 70aab63e4b..4dc2b85b86 100644
--- a/block.c
+++ b/block.c
@@ -3139,6 +3139,7 @@ int bdrv_in_use(BlockDriverState *bs)
void bdrv_iostatus_enable(BlockDriverState *bs)
{
+ bs->iostatus_enabled = true;
bs->iostatus = BDRV_IOS_OK;
}
@@ -3146,7 +3147,7 @@ void bdrv_iostatus_enable(BlockDriverState *bs)
* enables it _and_ the VM is configured to stop on errors */
bool bdrv_iostatus_is_enabled(const BlockDriverState *bs)
{
- return (bs->iostatus != BDRV_IOS_INVAL &&
+ return (bs->iostatus_enabled &&
(bs->on_write_error == BLOCK_ERR_STOP_ENOSPC ||
bs->on_write_error == BLOCK_ERR_STOP_ANY ||
bs->on_read_error == BLOCK_ERR_STOP_ANY));
@@ -3154,7 +3155,7 @@ bool bdrv_iostatus_is_enabled(const BlockDriverState *bs)
void bdrv_iostatus_disable(BlockDriverState *bs)
{
- bs->iostatus = BDRV_IOS_INVAL;
+ bs->iostatus_enabled = false;
}
void bdrv_iostatus_reset(BlockDriverState *bs)