Skip to content

Commit fd2e4fb

Browse files
authored
petri/hyperv: Don't attempt screenshots when isolated (#1882)
Isolation blocks access to graphics forwarding from the guest, so this will error out every time. Removes a bunch of error logs from cvm hyperv tests.
1 parent 58e1a5c commit fd2e4fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

petri/src/vm/hyperv/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub struct HyperVPetriRuntime {
6060
log_tasks: Vec<Task<anyhow::Result<()>>>,
6161
temp_dir: tempfile::TempDir,
6262
is_openhcl: bool,
63+
is_isolated: bool,
6364
driver: DefaultDriver,
6465
}
6566

@@ -393,6 +394,7 @@ impl PetriVmmBackend for HyperVPetriBackend {
393394
log_tasks,
394395
temp_dir,
395396
is_openhcl: openhcl_config.is_some(),
397+
is_isolated: firmware.isolation().is_some(),
396398
driver: driver.clone(),
397399
})
398400
}
@@ -492,7 +494,7 @@ impl PetriVmRuntime for HyperVPetriRuntime {
492494
}
493495

494496
fn take_framebuffer_access(&mut self) -> Option<HyperVFramebufferAccess> {
495-
Some(HyperVFramebufferAccess {
497+
(!self.is_isolated).then(|| HyperVFramebufferAccess {
496498
vm: Arc::downgrade(&self.vm),
497499
})
498500
}

0 commit comments

Comments
 (0)