File tree Expand file tree Collapse file tree 5 files changed +21
-20
lines changed Expand file tree Collapse file tree 5 files changed +21
-20
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ repository = "https://github.com/rust-vmm/kvm-ioctls"
7
7
readme = " README.md"
8
8
keywords = [" kvm" ]
9
9
license = " Apache-2.0 OR MIT"
10
+ edition = " 2021"
10
11
11
12
[dependencies ]
12
13
libc = " 0.2.39"
Original file line number Diff line number Diff line change 4
4
use std:: fs:: File ;
5
5
use std:: os:: unix:: io:: { AsRawFd , FromRawFd , RawFd } ;
6
6
7
- use ioctls:: Result ;
7
+ use crate :: ioctls:: Result ;
8
+ use crate :: kvm_ioctls:: { KVM_GET_DEVICE_ATTR , KVM_HAS_DEVICE_ATTR , KVM_SET_DEVICE_ATTR } ;
8
9
use kvm_bindings:: kvm_device_attr;
9
- use kvm_ioctls:: { KVM_GET_DEVICE_ATTR , KVM_HAS_DEVICE_ATTR , KVM_SET_DEVICE_ATTR } ;
10
10
use vmm_sys_util:: errno;
11
11
use vmm_sys_util:: ioctl:: { ioctl_with_mut_ref, ioctl_with_ref} ;
12
12
@@ -178,7 +178,7 @@ impl FromRawFd for DeviceFd {
178
178
#[ cfg( test) ]
179
179
mod tests {
180
180
use super :: * ;
181
- use ioctls:: system:: Kvm ;
181
+ use crate :: ioctls:: system:: Kvm ;
182
182
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
183
183
use kvm_bindings:: {
184
184
kvm_device_type_KVM_DEV_TYPE_ARM_VGIC_V3, kvm_device_type_KVM_DEV_TYPE_VFIO,
@@ -238,7 +238,7 @@ mod tests {
238
238
#[ test]
239
239
#[ cfg( target_arch = "aarch64" ) ]
240
240
fn test_create_device ( ) {
241
- use ioctls:: vm:: { create_gic_device, set_supported_nr_irqs} ;
241
+ use crate :: ioctls:: vm:: { create_gic_device, set_supported_nr_irqs} ;
242
242
use kvm_bindings:: {
243
243
kvm_device_type_KVM_DEV_TYPE_FSL_MPIC_20, KVM_DEV_ARM_VGIC_GRP_NR_IRQS ,
244
244
} ;
Original file line number Diff line number Diff line change @@ -9,14 +9,14 @@ use std::fs::File;
9
9
use std:: os:: raw:: { c_char, c_ulong} ;
10
10
use std:: os:: unix:: io:: { AsRawFd , FromRawFd , RawFd } ;
11
11
12
- use cap:: Cap ;
13
- use ioctls:: vm:: { new_vmfd, VmFd } ;
14
- use ioctls:: Result ;
12
+ use crate :: cap:: Cap ;
13
+ use crate :: ioctls:: vm:: { new_vmfd, VmFd } ;
14
+ use crate :: ioctls:: Result ;
15
+ use crate :: kvm_ioctls:: * ;
15
16
#[ cfg( any( target_arch = "aarch64" ) ) ]
16
17
use kvm_bindings:: KVM_VM_TYPE_ARM_IPA_SIZE_MASK ;
17
18
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
18
19
use kvm_bindings:: { CpuId , MsrList , KVM_MAX_CPUID_ENTRIES , KVM_MAX_MSR_ENTRIES } ;
19
- use kvm_ioctls:: * ;
20
20
use vmm_sys_util:: errno;
21
21
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
22
22
use vmm_sys_util:: ioctl:: ioctl_with_mut_ptr;
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ use libc::EINVAL;
10
10
use std:: fs:: File ;
11
11
use std:: os:: unix:: io:: { AsRawFd , RawFd } ;
12
12
13
- use ioctls:: { KvmRunWrapper , Result } ;
13
+ use crate :: ioctls:: { KvmRunWrapper , Result } ;
14
+ use crate :: kvm_ioctls:: * ;
14
15
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
15
16
use kvm_bindings:: { CpuId , Msrs , KVM_MAX_CPUID_ENTRIES } ;
16
- use kvm_ioctls:: * ;
17
17
use vmm_sys_util:: errno;
18
18
use vmm_sys_util:: ioctl:: { ioctl, ioctl_with_mut_ref, ioctl_with_ref} ;
19
19
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
@@ -1696,14 +1696,14 @@ mod tests {
1696
1696
extern crate byteorder;
1697
1697
1698
1698
use super :: * ;
1699
- use ioctls:: system:: Kvm ;
1700
1699
#[ cfg( any(
1701
1700
target_arch = "x86" ,
1702
1701
target_arch = "x86_64" ,
1703
1702
target_arch = "arm" ,
1704
1703
target_arch = "aarch64"
1705
1704
) ) ]
1706
- use Cap ;
1705
+ use crate :: cap:: Cap ;
1706
+ use crate :: ioctls:: system:: Kvm ;
1707
1707
1708
1708
// Helper function for memory mapping `size` bytes of anonymous memory.
1709
1709
// Panics if the mmap fails.
Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ use std::os::raw::c_void;
11
11
use std:: os:: raw:: { c_int, c_ulong} ;
12
12
use std:: os:: unix:: io:: { AsRawFd , FromRawFd , RawFd } ;
13
13
14
- use cap:: Cap ;
15
- use ioctls:: device:: new_device;
16
- use ioctls:: device:: DeviceFd ;
17
- use ioctls:: vcpu:: new_vcpu;
18
- use ioctls:: vcpu:: VcpuFd ;
19
- use ioctls:: { KvmRunWrapper , Result } ;
20
- use kvm_ioctls:: * ;
14
+ use crate :: cap:: Cap ;
15
+ use crate :: ioctls:: device:: new_device;
16
+ use crate :: ioctls:: device:: DeviceFd ;
17
+ use crate :: ioctls:: vcpu:: new_vcpu;
18
+ use crate :: ioctls:: vcpu:: VcpuFd ;
19
+ use crate :: ioctls:: { KvmRunWrapper , Result } ;
20
+ use crate :: kvm_ioctls:: * ;
21
21
use vmm_sys_util:: errno;
22
22
use vmm_sys_util:: eventfd:: EventFd ;
23
23
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
@@ -1649,7 +1649,7 @@ pub(crate) fn request_gic_init(vgic: &DeviceFd) {
1649
1649
#[ cfg( test) ]
1650
1650
mod tests {
1651
1651
use super :: * ;
1652
- use Kvm ;
1652
+ use crate :: Kvm ;
1653
1653
1654
1654
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
1655
1655
use std:: { fs:: OpenOptions , ptr:: null_mut} ;
You can’t perform that action at this time.
0 commit comments