mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
qerror: Clean up QERR_ macros to expand into a single string
These macros expand into error class enumeration constant, comma,
string. Unclean. Has been that way since commit 13f59ae
.
The error class is always ERROR_CLASS_GENERIC_ERROR since the previous
commit.
Clean up as follows:
* Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and
delete it from the QERR_ macro. No change after preprocessing.
* Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into
error_setg(...). Again, no change after preprocessing.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
75158ebbe2
commit
c6bd8c706a
54 changed files with 367 additions and 363 deletions
10
hmp.c
10
hmp.c
|
@ -1045,7 +1045,7 @@ void hmp_drive_mirror(Monitor *mon, const QDict *qdict)
|
|||
Error *err = NULL;
|
||||
|
||||
if (!filename) {
|
||||
error_set(&err, QERR_MISSING_PARAMETER, "target");
|
||||
error_setg(&err, QERR_MISSING_PARAMETER, "target");
|
||||
hmp_handle_error(mon, &err);
|
||||
return;
|
||||
}
|
||||
|
@ -1075,7 +1075,7 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict)
|
|||
Error *err = NULL;
|
||||
|
||||
if (!filename) {
|
||||
error_set(&err, QERR_MISSING_PARAMETER, "target");
|
||||
error_setg(&err, QERR_MISSING_PARAMETER, "target");
|
||||
hmp_handle_error(mon, &err);
|
||||
return;
|
||||
}
|
||||
|
@ -1105,7 +1105,7 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)
|
|||
if (!filename) {
|
||||
/* In the future, if 'snapshot-file' is not specified, the snapshot
|
||||
will be taken internally. Today it's actually required. */
|
||||
error_set(&err, QERR_MISSING_PARAMETER, "snapshot-file");
|
||||
error_setg(&err, QERR_MISSING_PARAMETER, "snapshot-file");
|
||||
hmp_handle_error(mon, &err);
|
||||
return;
|
||||
}
|
||||
|
@ -1200,7 +1200,7 @@ void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict)
|
|||
}
|
||||
|
||||
if (i == MIGRATION_CAPABILITY_MAX) {
|
||||
error_set(&err, QERR_INVALID_PARAMETER, cap);
|
||||
error_setg(&err, QERR_INVALID_PARAMETER, cap);
|
||||
}
|
||||
|
||||
qapi_free_MigrationCapabilityStatusList(caps);
|
||||
|
@ -1244,7 +1244,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
|
|||
}
|
||||
|
||||
if (i == MIGRATION_PARAMETER_MAX) {
|
||||
error_set(&err, QERR_INVALID_PARAMETER, param);
|
||||
error_setg(&err, QERR_INVALID_PARAMETER, param);
|
||||
}
|
||||
|
||||
if (err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue