summaryrefslogtreecommitdiff
path: root/migration/migration.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2017-10-05 22:00:31 +0200
committerJuan Quintela <quintela@redhat.com>2017-10-23 18:03:24 +0200
commit8acabf69ea36a5d8c09b4015b350afb3fc3bd12f (patch)
tree3eeb6cf88a37a53a5e6f8c69acf94594e6b5010a /migration/migration.c
parent9ca3f963949c88ac58f81de5e1e391bfcd7dbaa3 (diff)
downloadqemu-8acabf69ea36a5d8c09b4015b350afb3fc3bd12f.zip
migration: Move xbzrle cache resize error handling to xbzrle_cache_resize
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/migration/migration.c b/migration/migration.c
index fb62a639d8..3feffb5e26 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1373,24 +1373,8 @@ void qmp_migrate_set_cache_size(int64_t value, Error **errp)
MigrationState *s = migrate_get_current();
int64_t new_size;
- /* Check for truncation */
- if (value != (size_t)value) {
- 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_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
- "exceeds guest ram size ");
- return;
- }
-
- new_size = xbzrle_cache_resize(value);
+ new_size = xbzrle_cache_resize(value, errp);
if (new_size < 0) {
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
- "is smaller than page size");
return;
}