summaryrefslogtreecommitdiff
path: root/block/commit.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-09-28 17:22:55 +0200
committerKevin Wolf <kwolf@redhat.com>2012-09-28 19:40:26 +0200
commit92aa5c6d77ac29574c1717bcf57827fa1e586f31 (patch)
treebac807fef0378023cffa43a8ddcc47b2ab29d10b /block/commit.c
parentff06f5f351c3b19d5cdcb8bcb9f9cc9a01cac066 (diff)
downloadqemu-92aa5c6d77ac29574c1717bcf57827fa1e586f31.tar.gz
iostatus: move BlockdevOnError declaration to QAPI
This will let block-stream reuse the enum. Places that used the enums are renamed accordingly. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/commit.c')
-rw-r--r--block/commit.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/block/commit.c b/block/commit.c
index cabb470b5b..733c91403c 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -34,7 +34,7 @@ typedef struct CommitBlockJob {
BlockDriverState *active;
BlockDriverState *top;
BlockDriverState *base;
- BlockErrorAction on_error;
+ BlockdevOnError on_error;
int base_flags;
int orig_overlay_flags;
} CommitBlockJob;
@@ -126,9 +126,9 @@ wait:
bytes_written += n * BDRV_SECTOR_SIZE;
}
if (ret < 0) {
- if (s->on_error == BLOCK_ERR_STOP_ANY ||
- s->on_error == BLOCK_ERR_REPORT ||
- (s->on_error == BLOCK_ERR_STOP_ENOSPC && ret == -ENOSPC)) {
+ if (s->on_error == BLOCKDEV_ON_ERROR_STOP ||
+ s->on_error == BLOCKDEV_ON_ERROR_REPORT||
+ (s->on_error == BLOCKDEV_ON_ERROR_ENOSPC && ret == -ENOSPC)) {
goto exit_free_buf;
} else {
n = 0;
@@ -182,7 +182,7 @@ static BlockJobType commit_job_type = {
void commit_start(BlockDriverState *bs, BlockDriverState *base,
BlockDriverState *top, int64_t speed,
- BlockErrorAction on_error, BlockDriverCompletionFunc *cb,
+ BlockdevOnError on_error, BlockDriverCompletionFunc *cb,
void *opaque, Error **errp)
{
CommitBlockJob *s;
@@ -192,8 +192,8 @@ void commit_start(BlockDriverState *bs, BlockDriverState *base,
BlockDriverState *overlay_bs;
Error *local_err = NULL;
- if ((on_error == BLOCK_ERR_STOP_ANY ||
- on_error == BLOCK_ERR_STOP_ENOSPC) &&
+ if ((on_error == BLOCKDEV_ON_ERROR_STOP ||
+ on_error == BLOCKDEV_ON_ERROR_ENOSPC) &&
!bdrv_iostatus_is_enabled(bs)) {
error_set(errp, QERR_INVALID_PARAMETER_COMBINATION);
return;