Skip to content

Commit 9e98f95

Browse files
ita93lauralt
authored andcommitted
Upgrade to version 2021
Signed-off-by: Nguyen Dinh Phi <[email protected]>
1 parent d7b52c1 commit 9e98f95

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ repository = "https://github.com/rust-vmm/kvm-ioctls"
77
readme = "README.md"
88
keywords = ["kvm"]
99
license = "Apache-2.0 OR MIT"
10+
edition = "2021"
1011

1112
[dependencies]
1213
libc = "0.2.39"

src/ioctls/device.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
use std::fs::File;
55
use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
66

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};
89
use kvm_bindings::kvm_device_attr;
9-
use kvm_ioctls::{KVM_GET_DEVICE_ATTR, KVM_HAS_DEVICE_ATTR, KVM_SET_DEVICE_ATTR};
1010
use vmm_sys_util::errno;
1111
use vmm_sys_util::ioctl::{ioctl_with_mut_ref, ioctl_with_ref};
1212

@@ -178,7 +178,7 @@ impl FromRawFd for DeviceFd {
178178
#[cfg(test)]
179179
mod tests {
180180
use super::*;
181-
use ioctls::system::Kvm;
181+
use crate::ioctls::system::Kvm;
182182
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
183183
use kvm_bindings::{
184184
kvm_device_type_KVM_DEV_TYPE_ARM_VGIC_V3, kvm_device_type_KVM_DEV_TYPE_VFIO,
@@ -238,7 +238,7 @@ mod tests {
238238
#[test]
239239
#[cfg(target_arch = "aarch64")]
240240
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};
242242
use kvm_bindings::{
243243
kvm_device_type_KVM_DEV_TYPE_FSL_MPIC_20, KVM_DEV_ARM_VGIC_GRP_NR_IRQS,
244244
};

src/ioctls/system.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ use std::fs::File;
99
use std::os::raw::{c_char, c_ulong};
1010
use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
1111

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::*;
1516
#[cfg(any(target_arch = "aarch64"))]
1617
use kvm_bindings::KVM_VM_TYPE_ARM_IPA_SIZE_MASK;
1718
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
1819
use kvm_bindings::{CpuId, MsrList, KVM_MAX_CPUID_ENTRIES, KVM_MAX_MSR_ENTRIES};
19-
use kvm_ioctls::*;
2020
use vmm_sys_util::errno;
2121
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
2222
use vmm_sys_util::ioctl::ioctl_with_mut_ptr;

src/ioctls/vcpu.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ use libc::EINVAL;
1010
use std::fs::File;
1111
use std::os::unix::io::{AsRawFd, RawFd};
1212

13-
use ioctls::{KvmRunWrapper, Result};
13+
use crate::ioctls::{KvmRunWrapper, Result};
14+
use crate::kvm_ioctls::*;
1415
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
1516
use kvm_bindings::{CpuId, Msrs, KVM_MAX_CPUID_ENTRIES};
16-
use kvm_ioctls::*;
1717
use vmm_sys_util::errno;
1818
use vmm_sys_util::ioctl::{ioctl, ioctl_with_mut_ref, ioctl_with_ref};
1919
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
@@ -1696,14 +1696,14 @@ mod tests {
16961696
extern crate byteorder;
16971697

16981698
use super::*;
1699-
use ioctls::system::Kvm;
17001699
#[cfg(any(
17011700
target_arch = "x86",
17021701
target_arch = "x86_64",
17031702
target_arch = "arm",
17041703
target_arch = "aarch64"
17051704
))]
1706-
use Cap;
1705+
use crate::cap::Cap;
1706+
use crate::ioctls::system::Kvm;
17071707

17081708
// Helper function for memory mapping `size` bytes of anonymous memory.
17091709
// Panics if the mmap fails.

src/ioctls/vm.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ use std::os::raw::c_void;
1111
use std::os::raw::{c_int, c_ulong};
1212
use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
1313

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::*;
2121
use vmm_sys_util::errno;
2222
use vmm_sys_util::eventfd::EventFd;
2323
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
@@ -1649,7 +1649,7 @@ pub(crate) fn request_gic_init(vgic: &DeviceFd) {
16491649
#[cfg(test)]
16501650
mod tests {
16511651
use super::*;
1652-
use Kvm;
1652+
use crate::Kvm;
16531653

16541654
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
16551655
use std::{fs::OpenOptions, ptr::null_mut};

0 commit comments

Comments
 (0)