summaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-03-17 11:54:50 +0100
committerMarkus Armbruster <armbru@redhat.com>2015-06-22 18:20:40 +0200
commitc6bd8c706a799eb0fece99f468aaa22b818036f3 (patch)
treef6f5c9119c642fee35cdd98957c3bfd30527a76d /migration
parent75158ebbe259f0bd8bf435e8f4827a43ec89c877 (diff)
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>
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c35
-rw-r--r--migration/savevm.c2
2 files changed, 19 insertions, 18 deletions
diff --git a/migration/migration.c b/migration/migration.c
index b04b4571a8..a46deb2c40 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -337,7 +337,7 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
if (s->state == MIGRATION_STATUS_ACTIVE ||
s->state == MIGRATION_STATUS_SETUP) {
- error_set(errp, QERR_MIGRATION_ACTIVE);
+ error_setg(errp, QERR_MIGRATION_ACTIVE);
return;
}
@@ -356,22 +356,22 @@ void qmp_migrate_set_parameters(bool has_compress_level,
MigrationState *s = migrate_get_current();
if (has_compress_level && (compress_level < 0 || compress_level > 9)) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level",
- "is invalid, it should be in the range of 0 to 9");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level",
+ "is invalid, it should be in the range of 0 to 9");
return;
}
if (has_compress_threads &&
(compress_threads < 1 || compress_threads > 255)) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE,
- "compress_threads",
- "is invalid, it should be in the range of 1 to 255");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ "compress_threads",
+ "is invalid, it should be in the range of 1 to 255");
return;
}
if (has_decompress_threads &&
(decompress_threads < 1 || decompress_threads > 255)) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE,
- "decompress_threads",
- "is invalid, it should be in the range of 1 to 255");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ "decompress_threads",
+ "is invalid, it should be in the range of 1 to 255");
return;
}
@@ -573,7 +573,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
if (s->state == MIGRATION_STATUS_ACTIVE ||
s->state == MIGRATION_STATUS_SETUP ||
s->state == MIGRATION_STATUS_CANCELLING) {
- error_set(errp, QERR_MIGRATION_ACTIVE);
+ error_setg(errp, QERR_MIGRATION_ACTIVE);
return;
}
@@ -608,7 +608,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
fd_start_outgoing_migration(s, p, &local_err);
#endif
} else {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, "uri", "a valid migration protocol");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "uri",
+ "a valid migration protocol");
s->state = MIGRATION_STATUS_FAILED;
return;
}
@@ -632,22 +633,22 @@ void qmp_migrate_set_cache_size(int64_t value, Error **errp)
/* Check for truncation */
if (value != (size_t)value) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
- "exceeding address space");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
+ "exceeding address space");
return;
}
/* Cache should not be larger than guest ram size */
if (value > ram_bytes_total()) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
- "exceeds guest ram size ");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
+ "exceeds guest ram size ");
return;
}
new_size = xbzrle_cache_resize(value);
if (new_size < 0) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
- "is smaller than page size");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
+ "is smaller than page size");
return;
}
diff --git a/migration/savevm.c b/migration/savevm.c
index 2091882196..1acf6ff589 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1307,7 +1307,7 @@ void qmp_xen_save_devices_state(const char *filename, Error **errp)
ret = qemu_save_device_state(f);
qemu_fclose(f);
if (ret < 0) {
- error_set(errp, QERR_IO_ERROR);
+ error_setg(errp, QERR_IO_ERROR);
}
the_end: