mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-17 06:48:51 +00:00
runtime: Instantiate/pass vfio-ap device to ociSpec
This commit adds the missing step of passing an attached vfio-ap device to a container via ociSpec. It instantiates and passes a vfio-ap device (e.g. a Z crypto device). A device at `/dev/z90crypt` covers all use cases at the time of writing. Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
This commit is contained in:
@@ -933,7 +933,11 @@ async fn vfio_ap_device_handler(
|
|||||||
for apqn in device.options.iter() {
|
for apqn in device.options.iter() {
|
||||||
wait_for_ap_device(sandbox, ap::Address::from_str(apqn)?).await?;
|
wait_for_ap_device(sandbox, ap::Address::from_str(apqn)?).await?;
|
||||||
}
|
}
|
||||||
Ok(Default::default())
|
let dev_update = Some(DevUpdate::new(Z9_CRYPT_DEV_PATH, Z9_CRYPT_DEV_PATH)?);
|
||||||
|
Ok(SpecUpdate {
|
||||||
|
dev: dev_update,
|
||||||
|
pci: Vec::new(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_arch = "s390x"))]
|
#[cfg(not(target_arch = "s390x"))]
|
||||||
|
@@ -71,6 +71,7 @@ cfg_if! {
|
|||||||
pub const CCW_ROOT_BUS_PATH: &str = "/devices/css0";
|
pub const CCW_ROOT_BUS_PATH: &str = "/devices/css0";
|
||||||
pub const AP_ROOT_BUS_PATH: &str = "/devices/ap";
|
pub const AP_ROOT_BUS_PATH: &str = "/devices/ap";
|
||||||
pub const AP_SCANS_PATH: &str = "/sys/bus/ap/scans";
|
pub const AP_SCANS_PATH: &str = "/sys/bus/ap/scans";
|
||||||
|
pub const Z9_CRYPT_DEV_PATH: &str = "/dev/z90crypt";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user