MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / wait_for_generation_change

Function wait_for_generation_change

tdx-attest/src/linux.rs:437–452  ·  view source on GitHub ↗
(path: &str, current: i64)

Source from the content-addressed store, hash-verified

435}
436
437fn wait_for_generation_change(path: &str, current: i64) -> Result<i64> {
438 let deadline = Instant::now() + Duration::from_secs(CONFIGFS_GEN_WAIT_TIMEOUT_SECS);
439
440 loop {
441 let gen = read_generation(path)?;
442 if gen != current {
443 return Ok(gen);
444 }
445 if Instant::now() >= deadline {
446 return Err(TdxAttestError::QuoteFailure(
447 "timed out waiting for configfs generation to advance".to_string(),
448 ));
449 }
450 thread::sleep(Duration::from_millis(CONFIGFS_GEN_POLL_INTERVAL_MS));
451 }
452}
453
454fn read_outblob_with_retry(path: &str) -> Result<Vec<u8>> {
455 const RETRY_WAIT_MS: u64 = 10000;

Callers 1

get_quote_via_configfsFunction · 0.85

Calls 1

read_generationFunction · 0.85

Tested by

no test coverage detected