mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
block: use Error mechanism instead of -errno for block_job_set_speed()
There are at least two different errors that can occur in block_job_set_speed(): the job might not support setting speeds or the value might be invalid. Use the Error mechanism to report the error where it occurs. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
fd7f8c6537
commit
9e6636c72d
5 changed files with 18 additions and 15 deletions
|
@ -1145,9 +1145,7 @@ void qmp_block_job_set_speed(const char *device, int64_t value, Error **errp)
|
|||
return;
|
||||
}
|
||||
|
||||
if (block_job_set_speed(job, value) < 0) {
|
||||
error_set(errp, QERR_NOT_SUPPORTED);
|
||||
}
|
||||
block_job_set_speed(job, value, errp);
|
||||
}
|
||||
|
||||
void qmp_block_job_cancel(const char *device, Error **errp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue