mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
block: Fix blockdev-backup not to use funky error class
Error classes are a leftover from the days of "rich" error objects. New code should always use ERROR_CLASS_GENERIC_ERROR. Commit b7b9d39..7c6a4ab added uses of ERROR_CLASS_DEVICE_NOT_FOUND. Replace them. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
965182549c
commit
5b347c5410
3 changed files with 11 additions and 11 deletions
|
@ -1574,14 +1574,14 @@ static void blockdev_backup_prepare(BlkTransactionState *common, Error **errp)
|
|||
|
||||
blk = blk_by_name(backup->device);
|
||||
if (!blk) {
|
||||
error_set(errp, QERR_DEVICE_NOT_FOUND, backup->device);
|
||||
error_setg(errp, "Device '%s' not found", backup->device);
|
||||
return;
|
||||
}
|
||||
bs = blk_bs(blk);
|
||||
|
||||
blk = blk_by_name(backup->target);
|
||||
if (!blk) {
|
||||
error_set(errp, QERR_DEVICE_NOT_FOUND, backup->target);
|
||||
error_setg(errp, "Device '%s' not found", backup->target);
|
||||
return;
|
||||
}
|
||||
target = blk_bs(blk);
|
||||
|
@ -2421,7 +2421,7 @@ void qmp_blockdev_backup(const char *device, const char *target,
|
|||
|
||||
blk = blk_by_name(device);
|
||||
if (!blk) {
|
||||
error_set(errp, QERR_DEVICE_NOT_FOUND, device);
|
||||
error_setg(errp, "Device '%s' not found", device);
|
||||
return;
|
||||
}
|
||||
bs = blk_bs(blk);
|
||||
|
@ -2431,7 +2431,7 @@ void qmp_blockdev_backup(const char *device, const char *target,
|
|||
|
||||
blk = blk_by_name(target);
|
||||
if (!blk) {
|
||||
error_set(errp, QERR_DEVICE_NOT_FOUND, target);
|
||||
error_setg(errp, "Device '%s' not found", target);
|
||||
goto out;
|
||||
}
|
||||
target_bs = blk_bs(blk);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue