mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-02 21:00:55 +00:00
feature(xen-preflight): test for hypervisor presence explicitly and error if missing (#347)
Fixes #309
This commit is contained in:
parent
274136825a
commit
6a6b5b6e0b
@ -1,5 +1,6 @@
|
||||
use anyhow::{anyhow, Result};
|
||||
use krataloopdev::LoopControl;
|
||||
use log::debug;
|
||||
use std::{fs, path::PathBuf, str::FromStr, sync::Arc};
|
||||
use tokio::sync::Semaphore;
|
||||
use uuid::Uuid;
|
||||
@ -168,6 +169,13 @@ pub struct Runtime {
|
||||
impl Runtime {
|
||||
pub async fn new() -> Result<Self> {
|
||||
let context = RuntimeContext::new().await?;
|
||||
debug!("testing for hypervisor presence");
|
||||
context
|
||||
.xen
|
||||
.call
|
||||
.get_version_capabilities()
|
||||
.await
|
||||
.map_err(|_| anyhow!("hypervisor is not present"))?;
|
||||
Ok(Self {
|
||||
context,
|
||||
launch_semaphore: Arc::new(Semaphore::new(10)),
|
||||
|
Loading…
Reference in New Issue
Block a user