From 565599807fee415a2e071d2c4f532f4e3bb18dcb Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 3 Nov 2021 20:24:27 +0100 Subject: [PATCH 1/2] migration: Check that postcopy fd's are not NULL If postcopy has finished, it frees the array. But vhost-user unregister it at cleanup time. fixes: c4f7538 Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/postcopy-ram.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index e721f69d0f..d18b5d05b2 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -1457,6 +1457,10 @@ void postcopy_unregister_shared_ufd(struct PostCopyFD *pcfd) MigrationIncomingState *mis = migration_incoming_get_current(); GArray *pcrfds = mis->postcopy_remote_fds; + if (!pcrfds) { + /* migration has already finished and freed the array */ + return; + } for (i = 0; i < pcrfds->len; i++) { struct PostCopyFD *cur = &g_array_index(pcrfds, struct PostCopyFD, i); if (cur->fd == pcfd->fd) { From f78d4ed701454f10079461b981ba2a61a95762ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?= Date: Fri, 5 Nov 2021 21:01:16 +0800 Subject: [PATCH 2/2] docs: fix qemu incorrect tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patchset merged in 71864eadd9a ("migration/dirtyrate: introduce struct and adjust DirtyRateStat") was targeting QEMU 6.1 but got merged later, so correct the tag for 6.2. Signed-off-by: Hyman Huang(黄勇) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- qapi/migration.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qapi/migration.json b/qapi/migration.json index 87146ceea2..f0aefdab64 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1740,7 +1740,7 @@ # # @dirty-rate: dirty rate. # -# Since: 6.1 +# Since: 6.2 # ## { 'struct': 'DirtyRateVcpu', @@ -1774,7 +1774,7 @@ # # @dirty-bitmap: calculate dirtyrate by dirty bitmap. # -# Since: 6.1 +# Since: 6.2 # ## { 'enum': 'DirtyRateMeasureMode', @@ -1796,13 +1796,13 @@ # @calc-time: time in units of second for sample dirty pages # # @sample-pages: page count per GB for sample dirty pages -# the default value is 512 (since 6.1) +# the default value is 512 (since 6.2) # # @mode: mode containing method of calculate dirtyrate includes -# 'page-sampling' and 'dirty-ring' (Since 6.1) +# 'page-sampling' and 'dirty-ring' (Since 6.2) # # @vcpu-dirty-rate: dirtyrate for each vcpu if dirty-ring -# mode specified (Since 6.1) +# mode specified (Since 6.2) # # Since: 5.2 #