mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
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:
parent
1daef5e8c9
commit
1676fffaad
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user