mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +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:
@@ -2127,6 +2127,15 @@ impl Snapshottable for Vm {
|
|||||||
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
|
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
|
||||||
event!("vm", "snapshotting");
|
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();
|
let current_state = self.get_state().unwrap();
|
||||||
if current_state != VmState::Paused {
|
if current_state != VmState::Paused {
|
||||||
return Err(MigratableError::Snapshot(anyhow!(
|
return Err(MigratableError::Snapshot(anyhow!(
|
||||||
|
|||||||
Reference in New Issue
Block a user