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
1 changed files with 9 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue