Migration fixes
cover Migration fixes
From: "Dr. David Alan Gilbert" <[email protected]>
Hi,
These are 3 migration fixes that fix things I messed up.
Only the 1st one (set last_sent_block) fixes a problem, the other two fix coverity findings.
Dave
Dr. David Alan Gilbert (3):
Set last_sent_block
migration: Dead assignment of current_time
Unneeded NULL check
migration/migration.c | 3 +-- migration/ram.c | 1 + 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.5.0
PATCH 1/3 Set last_sent_block
From: "Dr. David Alan Gilbert" <[email protected]>
In a82d593b61054b3dea43 I accidentally removed the setting of last_sent_block, put it back.
Symptoms:
Multithreaded compression only uses one thread. Migration is a bit less efficient since it won't use 'cont' flags.
--- migration/ram.c | 1 + 1 file changed, 1 insertion(+)
migration/ram.c +1 -0
@@ -1249,6 +1249,7 @@ static int ram_save_target_page(MigrationState *ms, QEMUFile *f,if (unsentmap) {clear_bit (dirty_ram_abs >>TARGET_PAGE_BITS , unsentmap); } + last_sent_block = block; }return res;
Signature · 1 line
2.5.0
Re: [Qemu-devel] [PATCH 1/3] Set last_sent_block
Quoted 11 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
In
a82d593b61054b3dea43I accidentally removed the setting oflast_sent_block, put it back.Symptoms:
Multithreaded compression only uses one thread. Migration is a bit less efficient since it won't use 'cont' flags.Signed-off-by Dr. David Alan Gilbert <[email protected]>Fixes a82d593b61054b3dea43
PATCH 2/3 migration: Dead assignment of current_time
In reply to Dr. David Alan Gilbert (git)From: "Dr. David Alan Gilbert" <[email protected]>
I set current_time before the postcopy test but never use it; (I think this was from the original version where it was time based). Spotted by coverity, CID 1339208
--- migration/migration.c | 1 - 1 file changed, 1 deletion(-)
migration/migration.c +0 -1
@@ -1643,7 +1643,6 @@ static void *migration_thread(void *opaque)if (pending_size && pending_size >= max_size) {/* Still a significant amount to transfer */ - current_time =qemu_clock_get_ms (QEMU_CLOCK_REALTIME ); if (migrate_postcopy_ram() && s->state != MIGRATION_STATUS_POSTCOPY_ACTIVE && pend_nonpost <= max_size &&
Signature · 1 line
2.5.0
Re: [Qemu-devel] [PATCH 2/3] migration: Dead assignment of current_time
Quoted 7 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
I set
current_timebefore the postcopy test but never use it; (I think this was from the original version where it was time based). Spotted by coverity, CID 1339208Signed-off-by Dr. David Alan Gilbert <[email protected]>
PATCH 3/3 Unneeded NULL check
In reply to Dr. David Alan Gilbert (git)From: "Dr. David Alan Gilbert" <[email protected]>
The check is unneccesary, we read the value at the start of the thread, use it, and never change it. The value is checked to be non-NULL before thread creation.
Spotted by coverity, CID 1339211
--- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
@@ -1345,7 +1345,7 @@ static void *source_return_path_thread(void *opaque)break ; } } -if (rp &&qemu_file_get_error (rp)) { +if (qemu_file_get_error (rp)) {trace_source_return_path_thread_bad_end ();mark_source_rp_bad (ms); }
Signature · 1 line
2.5.0
Re: [Qemu-devel] [PATCH 3/3] Unneeded NULL check
Quoted 9 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
The check is unneccesary, we read the value at the start of the thread, use it, and never change it. The value is checked to be non-NULL before thread creation.
Spotted by coverity, CID 1339211
Signed-off-by Dr. David Alan Gilbert <[email protected]>