Skip to content

Commit

Permalink
qerror/block: introduce QERR_BLOCK_JOB_NOT_ACTIVE
Browse files Browse the repository at this point in the history
The DeviceNotActive text is not a particularly good match, add
a separate text while keeping the same class.

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
bonzini authored and kevmw committed Sep 28, 2012
1 parent 747051c commit 7ef1507
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blockdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ void qmp_block_job_set_speed(const char *device, int64_t speed, Error **errp)
BlockJob *job = find_block_job(device);

if (!job) {
error_set(errp, QERR_DEVICE_NOT_ACTIVE, device);
error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);
return;
}

Expand All @@ -1217,7 +1217,7 @@ void qmp_block_job_cancel(const char *device, Error **errp)
BlockJob *job = find_block_job(device);

if (!job) {
error_set(errp, QERR_DEVICE_NOT_ACTIVE, device);
error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);
return;
}

Expand Down
3 changes: 3 additions & 0 deletions qerror.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ void assert_no_error(Error *err);
#define QERR_BASE_NOT_FOUND \
ERROR_CLASS_GENERIC_ERROR, "Base '%s' not found"

#define QERR_BLOCK_JOB_NOT_ACTIVE \
ERROR_CLASS_DEVICE_NOT_ACTIVE, "No active block job on device '%s'"

#define QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED \
ERROR_CLASS_GENERIC_ERROR, "Block format '%s' used by device '%s' does not support feature '%s'"

Expand Down

0 comments on commit 7ef1507

Please sign in to comment.