Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit 9fdcb4c

Browse files
RuoqingHerbradford
authored andcommitted
riscv64: Enable create_device doc test
Complete `create_device` doc test to create the creation of AIA device on RISC-V 64-bit platform. Signed-off-by: Ruoqing He <[email protected]>
1 parent 908ce9b commit 9fdcb4c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ioctls/vm.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,8 @@ impl VmFd {
12591259
/// # use kvm_ioctls::Kvm;
12601260
/// use kvm_bindings::{
12611261
/// kvm_device_type_KVM_DEV_TYPE_ARM_VGIC_V2, kvm_device_type_KVM_DEV_TYPE_ARM_VGIC_V3,
1262-
/// kvm_device_type_KVM_DEV_TYPE_VFIO, KVM_CREATE_DEVICE_TEST,
1262+
/// kvm_device_type_KVM_DEV_TYPE_RISCV_AIA, kvm_device_type_KVM_DEV_TYPE_VFIO,
1263+
/// KVM_CREATE_DEVICE_TEST,
12631264
/// };
12641265
/// let kvm = Kvm::new().unwrap();
12651266
/// let vm = kvm.create_vm().unwrap();
@@ -1272,6 +1273,8 @@ impl VmFd {
12721273
/// type_: kvm_device_type_KVM_DEV_TYPE_VFIO,
12731274
/// #[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
12741275
/// type_: kvm_device_type_KVM_DEV_TYPE_ARM_VGIC_V3,
1276+
/// #[cfg(target_arch = "riscv64")]
1277+
/// type_: kvm_device_type_KVM_DEV_TYPE_RISCV_AIA,
12751278
/// fd: 0,
12761279
/// flags: KVM_CREATE_DEVICE_TEST,
12771280
/// };
@@ -1286,6 +1289,8 @@ impl VmFd {
12861289
/// vm.create_device(&mut device)
12871290
/// .expect("Cannot create vGIC device")
12881291
/// }
1292+
/// #[cfg(target_arch = "riscv64")]
1293+
/// panic!("Cannot create vAIA device.");
12891294
/// });
12901295
/// ```
12911296
pub fn create_device(&self, device: &mut kvm_create_device) -> Result<DeviceFd> {

0 commit comments

Comments
 (0)