@@ -606,7 +606,7 @@ impl VmFd {
606
606
/// # extern crate kvm_ioctls;
607
607
/// extern crate kvm_bindings;
608
608
/// # use kvm_ioctls::Kvm;
609
- /// use kvm_bindings::kvm_irq_routing ;
609
+ /// use kvm_bindings::KvmIrqRouting ;
610
610
///
611
611
/// let kvm = Kvm::new().unwrap();
612
612
/// let vm = kvm.create_vm().unwrap();
@@ -622,18 +622,19 @@ impl VmFd {
622
622
/// })
623
623
/// .expect("Cannot create KVM vAIA device.");
624
624
///
625
- /// let irq_routing = kvm_irq_routing::default ();
625
+ /// let irq_routing = KvmIrqRouting::new(0).unwrap ();
626
626
/// vm.set_gsi_routing(&irq_routing).unwrap();
627
627
/// ```
628
628
#[ cfg( any(
629
629
target_arch = "x86_64" ,
630
630
target_arch = "aarch64" ,
631
631
target_arch = "riscv64"
632
632
) ) ]
633
- pub fn set_gsi_routing ( & self , irq_routing : & kvm_irq_routing ) -> Result < ( ) > {
633
+ pub fn set_gsi_routing ( & self , irq_routing : & KvmIrqRouting ) -> Result < ( ) > {
634
634
// SAFETY: Safe because we allocated the structure and we know the kernel
635
635
// will read exactly the size of the structure.
636
- let ret = unsafe { ioctl_with_ref ( self , KVM_SET_GSI_ROUTING ( ) , irq_routing) } ;
636
+ let ret =
637
+ unsafe { ioctl_with_ref ( self , KVM_SET_GSI_ROUTING ( ) , irq_routing. as_fam_struct_ref ( ) ) } ;
637
638
if ret == 0 {
638
639
Ok ( ( ) )
639
640
} else {
@@ -2669,7 +2670,7 @@ mod tests {
2669
2670
fn test_set_gsi_routing ( ) {
2670
2671
let kvm = Kvm :: new ( ) . unwrap ( ) ;
2671
2672
let vm = kvm. create_vm ( ) . unwrap ( ) ;
2672
- let irq_routing = kvm_irq_routing :: default ( ) ;
2673
+ let irq_routing = KvmIrqRouting :: new ( 0 ) . unwrap ( ) ;
2673
2674
2674
2675
// Expect failure for x86 since the irqchip is not created yet.
2675
2676
#[ cfg( target_arch = "x86_64" ) ]
0 commit comments