vmm: Stop dirty logging only if it has been started

Now that we introduced a separate method to indicate when the migration
is started, both start_dirty_log() and stop_dirty_log() don't have to
carry an implicit meaning as they can focus entirely on the dirty log
being started or stopped.

For that reason, we can now safely move stop_dirty_log() to the code
section performing non-local migration. It makes only sense to stop
logging dirty pages if this has been started before.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2022-02-03 10:43:11 +01:00
parent a45e458c50
commit b3ca1d90e9

View File

@ -1142,6 +1142,9 @@ impl Vmm {
// Send last batch of dirty pages
Self::vm_maybe_send_dirty_pages(vm, &mut socket)?;
// Stop logging dirty pages
vm.stop_dirty_log()?;
}
// Capture snapshot and send it
let vm_snapshot = vm.snapshot()?;
@ -1174,12 +1177,7 @@ impl Vmm {
info!("Migration complete");
// Let every Migratable object know about the migration being complete
vm.complete_migration()?;
// Stop logging dirty pages
vm.stop_dirty_log()?;
Ok(())
vm.complete_migration()
}
fn vm_send_migration(