vmm: simplify receiving memory fds

... and nuke some Option<> while I was there. Given that HashMap has a
usable default and we end up passing an empty HashMap anyway, just get
rid of the Option.

On-behalf-of: SAP julian.stecklina@sap.com
Signed-off-by: Julian Stecklina <julian.stecklina@cyberus-technology.de>
This commit is contained in:
Julian Stecklina
2025-11-03 16:27:12 +01:00
committed by Rob Bradford
parent 3d43245608
commit 1861bc49e7
3 changed files with 28 additions and 34 deletions

View File

@@ -995,7 +995,7 @@ impl MemoryManager {
phys_bits: u8,
#[cfg(feature = "tdx")] tdx_enabled: bool,
restore_data: Option<&MemoryManagerSnapshotData>,
existing_memory_files: Option<HashMap<u32, File>>,
existing_memory_files: HashMap<u32, File>,
) -> Result<Arc<Mutex<MemoryManager>>, Error> {
trace_scoped!("MemoryManager::new");
@@ -1030,7 +1030,7 @@ impl MemoryManager {
&data.guest_ram_mappings,
&zones,
prefault,
existing_memory_files.unwrap_or_default(),
existing_memory_files,
config.thp,
)?;
let guest_memory =
@@ -1263,7 +1263,7 @@ impl MemoryManager {
#[cfg(feature = "tdx")]
false,
Some(&mem_snapshot),
None,
Default::default(),
)?;
mm.lock()