(path: &str, current: i64)
| 435 | } |
| 436 | |
| 437 | fn 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 | |
| 454 | fn read_outblob_with_retry(path: &str) -> Result<Vec<u8>> { |
| 455 | const RETRY_WAIT_MS: u64 = 10000; |
no test coverage detected