[i2c] separate imports

We've typically separated imports in 3 categories:
- Rust standard library
- external crates
- project internal imports (such as imports from user defined modules)

Signed-off-by: Andreea Florescu <fandree@amazon.com>
This commit is contained in:
Andreea Florescu 2021-09-15 15:19:41 +03:00
parent 850cbce112
commit 1a9b9e3fd6
2 changed files with 9 additions and 4 deletions

View File

@ -5,9 +5,10 @@
//
// SPDX-License-Identifier: Apache-2.0
use libc::{c_ulong, ioctl, EADDRINUSE, EADDRNOTAVAIL, EINVAL};
use std::fs::{File, OpenOptions};
use std::os::unix::io::AsRawFd;
use libc::{c_ulong, ioctl, EADDRINUSE, EADDRNOTAVAIL, EINVAL};
use vmm_sys_util::errno::{errno_result, Error, Result};
// The type of the `req` parameter is different for the `musl` library. This will enable

View File

@ -8,15 +8,19 @@
mod i2c;
mod vhu_i2c;
use clap::{load_yaml, App, ArgMatches};
use i2c::{I2cAdapter, I2cAdapterTrait, I2cMap};
use std::sync::{Arc, RwLock};
use std::thread::spawn;
use clap::{load_yaml, App, ArgMatches};
use vhost::{vhost_user, vhost_user::Listener};
use vhost_user_backend::VhostUserDaemon;
use vhu_i2c::VhostUserI2cBackend;
use vm_memory::{GuestMemoryAtomic, GuestMemoryMmap};
use i2c::{I2cAdapter, I2cAdapterTrait, I2cMap};
use std::convert::TryFrom;
use std::num::ParseIntError;
use vhu_i2c::VhostUserI2cBackend;
fn start_daemon<T: I2cAdapterTrait>(
backend: Arc<RwLock<VhostUserI2cBackend<T>>>,
listener: Listener,