diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 657a8ae8d..f832ba794 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -2127,6 +2127,15 @@ impl Snapshottable for Vm { fn snapshot(&mut self) -> std::result::Result { event!("vm", "snapshotting"); + #[cfg(feature = "tdx")] + { + if self.config.lock().unwrap().tdx.is_some() { + return Err(MigratableError::Snapshot(anyhow!( + "Snapshot not possible with TDX VM" + ))); + } + } + let current_state = self.get_state().unwrap(); if current_state != VmState::Paused { return Err(MigratableError::Snapshot(anyhow!(