Skip to content

Commit 85188a9

Browse files
committed
refactor: drop uffd parameter from create_vmm_and_vcpus
This way the non-snapshot path doesnt have to deal with passing in `None`. Signed-off-by: Patrick Roy <[email protected]>
1 parent d26fc1c commit 85188a9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/vmm/src/builder.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ impl std::convert::From<linux_loader::cmdline::Error> for StartMicrovmError {
134134
fn create_vmm_and_vcpus(
135135
instance_info: &InstanceInfo,
136136
event_manager: &mut EventManager,
137-
uffd: Option<Uffd>,
138137
vcpu_count: u8,
139138
kvm_capabilities: Vec<KvmCapability>,
140139
) -> Result<(Vmm, Vec<Vcpu>), VmmError> {
@@ -177,7 +176,7 @@ fn create_vmm_and_vcpus(
177176
shutdown_exit_code: None,
178177
kvm,
179178
vm,
180-
uffd,
179+
uffd: None,
181180
vcpus_handles: Vec::new(),
182181
vcpus_exit_evt,
183182
resource_allocator,
@@ -228,7 +227,6 @@ pub fn build_microvm_for_boot(
228227
let (mut vmm, mut vcpus) = create_vmm_and_vcpus(
229228
instance_info,
230229
event_manager,
231-
None,
232230
vm_resources.machine_config.vcpu_count,
233231
cpu_template.kvm_capabilities.clone(),
234232
)?;
@@ -424,7 +422,6 @@ pub fn build_microvm_from_snapshot(
424422
let (mut vmm, mut vcpus) = create_vmm_and_vcpus(
425423
instance_info,
426424
event_manager,
427-
uffd,
428425
vm_resources.machine_config.vcpu_count,
429426
microvm_state.kvm_state.kvm_cap_modifiers.clone(),
430427
)
@@ -434,6 +431,7 @@ pub fn build_microvm_from_snapshot(
434431
.register_memory_regions(guest_memory)
435432
.map_err(VmmError::Vm)
436433
.map_err(StartMicrovmError::Internal)?;
434+
vmm.uffd = uffd;
437435

438436
#[cfg(target_arch = "x86_64")]
439437
{

0 commit comments

Comments
 (0)