vmm: Check shared memory is enabled for local migration

This is required so that the receiving process can access the existing
process's memory.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-01-14 09:23:30 +00:00
parent 1daef5e8c9
commit 1676fffaad

View File

@ -1153,6 +1153,22 @@ impl Vmm {
"Sending migration: destination_url = {}, local = {}",
send_data_migration.destination_url, send_data_migration.local
);
if !self
.vm_config
.as_ref()
.unwrap()
.lock()
.unwrap()
.memory
.shared
&& send_data_migration.local
{
return Err(MigratableError::MigrateSend(anyhow!(
"Local migration requires shared memory enabled"
)));
}
if let Some(vm) = self.vm.as_mut() {
Self::send_migration(
vm,