diff options
-rw-r--r-- | hmp.c | 6 | ||||
-rw-r--r-- | migration/ram.c | 2 |
2 files changed, 6 insertions, 2 deletions
@@ -1825,8 +1825,10 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) case MIGRATION_PARAMETER_XBZRLE_CACHE_SIZE: p->has_xbzrle_cache_size = true; visit_type_size(v, param, &cache_size, &err); - if (err || cache_size > INT64_MAX - || (size_t)cache_size != cache_size) { + if (err) { + break; + } + if (cache_size > INT64_MAX || (size_t)cache_size != cache_size) { error_setg(&err, "Invalid size %s", valuestr); break; } diff --git a/migration/ram.c b/migration/ram.c index d7f8fe4..f68beee 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3918,6 +3918,7 @@ int colo_init_ram_cache(void) } ram_state = g_new0(RAMState, 1); ram_state->migration_dirty_pages = 0; + qemu_mutex_init(&ram_state->bitmap_mutex); memory_global_dirty_log_start(); return 0; @@ -3956,6 +3957,7 @@ void colo_release_ram_cache(void) } rcu_read_unlock(); + qemu_mutex_destroy(&ram_state->bitmap_mutex); g_free(ram_state); ram_state = NULL; } |