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

Commit 3a16618

Browse files
RuoqingHerbradford
authored andcommitted
riscv64: Enable set_gsi_routing doc test
RISC-V 64-bit requires an in-kernel interrupt chip (AIA) to be created in advance of committing `gsi_routing_table`. Signed-off-by: Ruoqing He <[email protected]>
1 parent 9fdcb4c commit 3a16618

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ioctls/vm.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,18 @@ impl VmFd {
619619
///
620620
/// let kvm = Kvm::new().unwrap();
621621
/// let vm = kvm.create_vm().unwrap();
622+
///
622623
/// #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
623624
/// vm.create_irq_chip().unwrap();
624625
///
626+
/// #[cfg(target_arch = "riscv64")]
627+
/// vm.create_device(&mut kvm_bindings::kvm_create_device {
628+
/// type_: kvm_bindings::kvm_device_type_KVM_DEV_TYPE_RISCV_AIA,
629+
/// fd: 0,
630+
/// flags: 0,
631+
/// })
632+
/// .expect("Cannot create KVM vAIA device.");
633+
///
625634
/// let irq_routing = kvm_irq_routing::default();
626635
/// vm.set_gsi_routing(&irq_routing).unwrap();
627636
/// ```

0 commit comments

Comments
 (0)