aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-04-06 00:22:34 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-04-06 00:22:34 +0100
commit90fb864a7df0a9af677352e94f8225f7b03de922 (patch)
tree5d96aad165c6ce872f1182856570dbfa9d594afc
parent10546e09e174e0bb185b66a4c397aa845efcd36e (diff)
parentd013283a46e1f197594e76ed320f867067ab80b3 (diff)
downloadqemu-90fb864a7df0a9af677352e94f8225f7b03de922.zip
qemu-90fb864a7df0a9af677352e94f8225f7b03de922.tar.gz
qemu-90fb864a7df0a9af677352e94f8225f7b03de922.tar.bz2
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20190405a' into staging
Migration fixes pull for 4.0 A couple of fixes for crashes in colo and migration parameters. # gpg: Signature made Fri 05 Apr 2019 16:47:38 BST # gpg: using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full] # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20190405a: migration: Fix migrate_set_parameter migration/ram.c: Fix codes conflict about bitmap_mutex Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hmp.c6
-rw-r--r--migration/ram.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/hmp.c b/hmp.c
index 9294114..8eec768 100644
--- a/hmp.c
+++ b/hmp.c
@@ -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;
}