diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-06-23 10:38:00 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-06-23 10:38:00 +0100 |
commit | a3206972a9eab65ec8e8f9ae320ad628ba4b58f1 (patch) | |
tree | f5109b0cced9784dde30aa2877aea30651933eee /migration/migration.c | |
parent | 0c8ff723bd29e5c8b2ca989f857ae5c37ec49c4e (diff) | |
parent | a0b1a66ea39bca011108734147a72232a4d08c7a (diff) |
Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-06-22' into staging
Monitor patches
# gpg: Signature made Mon Jun 22 18:56:18 2015 BST using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>"
* remotes/armbru/tags/pull-monitor-2015-06-22: (24 commits)
Include monitor/monitor.h exactly where needed
Include qapi/qmp/qerror.h exactly where needed
qerror: Move #include out of qerror.h
qerror: Finally unused, clean up
qmp: Wean off qerror_report()
tpm: Avoid qerror_report() outside QMP command handlers
qerror: Clean up QERR_ macros to expand into a single string
qerror: Eliminate QERR_DEVICE_NOT_FOUND
vl: Use error_report() for --display errors
vl: Avoid qerror_report() outside QMP command handlers
QemuOpts: Wean off qerror_report_err()
qdev-monitor: Propagate errors through qdev_device_add()
qdev-monitor: Propagate errors through set_property()
qdev-monitor: Convert qbus_find() to Error
qdev-monitor: Fix check for full bus
qdev-monitor: Stop error avalanche in qbus_find_recursive()
disas: Remove uses of CPU env
monitor: Split mon_get_cpu fn to remove ENV_GET_CPU
monitor: Fix failure path for "S" argument
monitor: Point to "help" command on syntax error
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'migration/migration.c')
-rw-r--r-- | migration/migration.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/migration/migration.c b/migration/migration.c index b04b4571a8..c6ac08a0cb 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -14,12 +14,13 @@ */ #include "qemu-common.h" +#include "qemu/error-report.h" #include "qemu/main-loop.h" #include "migration/migration.h" -#include "monitor/monitor.h" #include "migration/qemu-file.h" #include "sysemu/sysemu.h" #include "block/block.h" +#include "qapi/qmp/qerror.h" #include "qemu/sockets.h" #include "migration/block.h" #include "qemu/thread.h" @@ -337,7 +338,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 +357,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 +574,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 +609,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 +634,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; } |