vmm: Improve handling of shared memory backing

As huge pages are always MAP_SHARED then where the shared memory would
be checked (for vhost-user and local migration) we can also check
instead for huge pages.

The checking is also extended to cover the memory zones based
configuration as well.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2022-10-31 13:39:11 +00:00
parent 99d9a3d299
commit f4495de143
2 changed files with 31 additions and 9 deletions
+2 -3
View File
@@ -1606,12 +1606,11 @@ impl Vmm {
.unwrap()
.lock()
.unwrap()
.memory
.shared
.backed_by_shared_memory()
&& send_data_migration.local
{
return Err(MigratableError::MigrateSend(anyhow!(
"Local migration requires shared memory enabled"
"Local migration requires shared memory or hugepages enabled"
)));
}