mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-06 20:00:54 +00:00
vmm: Reject VM snapshot request if TDX in use
It is not possible to snapshot the contents of a TDX VM. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
835a31e283
commit
d24aa887b6
@ -2127,6 +2127,15 @@ impl Snapshottable for Vm {
|
||||
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
|
||||
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!(
|
||||
|
Loading…
x
Reference in New Issue
Block a user