summary refs log tree commit diff
path: root/kvm_sys
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@chromium.org>2019-04-12 12:18:35 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-15 02:06:07 -0700
commit633426a8fc20a5eef402e159d53228aae13bbaa5 (patch)
treeddc7e53a2baeebd3fdd15d724107e7f018de4dc4 /kvm_sys
parent62041f041956a2ccfdd0a340b65b8a2cb0749655 (diff)
downloadcrosvm-633426a8fc20a5eef402e159d53228aae13bbaa5.tar
crosvm-633426a8fc20a5eef402e159d53228aae13bbaa5.tar.gz
crosvm-633426a8fc20a5eef402e159d53228aae13bbaa5.tar.bz2
crosvm-633426a8fc20a5eef402e159d53228aae13bbaa5.tar.lz
crosvm-633426a8fc20a5eef402e159d53228aae13bbaa5.tar.xz
crosvm-633426a8fc20a5eef402e159d53228aae13bbaa5.tar.zst
crosvm-633426a8fc20a5eef402e159d53228aae13bbaa5.zip
edition: Fill in macro imports
Macros were previously imported through `#[macro_use] extern crate`,
which is basically a glob import of all macros from the crate. As of
2018 edition of Rust, `extern crate` is no longer required and macros
are imported individually like any other item from a dependency. This CL
fills in all the appropriate macro imports that will allow us to remove
our use of `extern crate` in a subsequent CL.

TEST=cargo check --all-features --tests
TEST=kokoro

Change-Id: If2ec08b06b743abf5f62677c6a9927c3d5d90a54
Reviewed-on: https://chromium-review.googlesource.com/1565546
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
Diffstat (limited to 'kvm_sys')
-rw-r--r--kvm_sys/src/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/kvm_sys/src/lib.rs b/kvm_sys/src/lib.rs
index efcc706..bea9242 100644
--- a/kvm_sys/src/lib.rs
+++ b/kvm_sys/src/lib.rs
@@ -9,6 +9,8 @@
 #[macro_use]
 extern crate sys_util;
 
+use sys_util::{ioctl_io_nr, ioctl_ior_nr, ioctl_iow_nr, ioctl_iowr_nr};
+
 // Somehow this one gets missed by bindgen
 pub const KVM_EXIT_IO_OUT: ::std::os::raw::c_uint = 1;
 
@@ -20,6 +22,7 @@ pub mod x86 {
     #[cfg_attr(feature = "cargo-clippy", allow(clippy))]
     pub mod bindings;
     pub use crate::bindings::*;
+    use sys_util::{ioctl_ior_nr, ioctl_iow_nr, ioctl_iowr_nr};
 
     ioctl_iow_nr!(KVM_SET_GSI_ROUTING, KVMIO, 0x6a, kvm_irq_routing);
     ioctl_iowr_nr!(KVM_GET_MSR_INDEX_LIST, KVMIO, 0x02, kvm_msr_list);
@@ -54,6 +57,7 @@ pub mod aarch64 {
     // generated with bindgen <arm sysroot>/usr/include/linux/kvm.h --no-unstable-rust --constified-enum '*' --with-derive-default -- -I<arm sysroot>/usr/include
     pub mod bindings;
     pub use bindings::*;
+    use sys_util::{ioctl_ior_nr, ioctl_iow_nr};
 
     ioctl_iow_nr!(KVM_ARM_SET_DEVICE_ADDR, KVMIO, 0xab, kvm_arm_device_addr);
     ioctl_iow_nr!(KVM_ARM_VCPU_INIT, KVMIO, 0xae, kvm_vcpu_init);