MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / cancel_cmd

Method cancel_cmd

tpm/src/emulator.rs:379–395  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

377 }
378
379 pub fn cancel_cmd(&mut self) -> Result<()> {
380 let mut res: PtmResult = 0;
381
382 // Check if emulator implements Cancel Cmd
383 if (self.caps & PTM_CAP_CANCEL_TPM_CMD) != PTM_CAP_CANCEL_TPM_CMD {
384 return Err(Error::CheckCaps(anyhow!(
385 "Emulator does not implement 'Cancel Command' Capability"
386 )));
387 }
388 self.run_control_cmd(
389 Commands::CmdCancelTpmCmd,
390 &mut res,
391 0,
392 mem::size_of::<u32>(),
393 )?;
394 Ok(())
395 }
396
397 /// Configure buffersize to use while communicating with swtpm
398 fn set_buffer_size(&mut self, wantedsize: usize) -> Result<usize> {

Callers 1

writeMethod · 0.80

Calls 1

run_control_cmdMethod · 0.80

Tested by

no test coverage detected