mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
devices: trim qualified paths
Import the modules used in the crate instead of spelling the fully-qualified paths at every use site, and collapse Result<T, io::Error> into io::Result<T>. This covers the feature-gated modules (fw_cfg, ivshmem, pvmemcontrol) as well, leaving the whole crate free of clippy::absolute_paths warnings. Signed-off-by: Henry Hrvoje Tonkovac <htonkovac@gmail.com> Assisted-by: Claude:Opus-4.8
This commit is contained in:
committed by
Rob Bradford
parent
9eff92fb4b
commit
181d29ee90
+6
-9
@@ -5,8 +5,8 @@
|
||||
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::{Arc, Barrier};
|
||||
use std::thread;
|
||||
use std::time::Instant;
|
||||
use std::time::{Duration, Instant};
|
||||
use std::{io, mem, thread};
|
||||
|
||||
use acpi_tables::{Aml, AmlSink, aml};
|
||||
use log::{error, info, warn};
|
||||
@@ -59,7 +59,7 @@ impl BusDevice for AcpiShutdownDevice {
|
||||
while !self.vcpus_kill_signalled.load(Ordering::SeqCst) {
|
||||
// This is more effective than thread::yield_now() at
|
||||
// avoiding a priority inversion with the VMM thread
|
||||
thread::sleep(std::time::Duration::from_millis(1));
|
||||
thread::sleep(Duration::from_millis(1));
|
||||
}
|
||||
}
|
||||
// The ACPI DSDT table specifies the S5 sleep state (shutdown) as value 5
|
||||
@@ -76,7 +76,7 @@ impl BusDevice for AcpiShutdownDevice {
|
||||
while !self.vcpus_kill_signalled.load(Ordering::SeqCst) {
|
||||
// This is more effective than thread::yield_now() at
|
||||
// avoiding a priority inversion with the VMM thread
|
||||
thread::sleep(std::time::Duration::from_millis(1));
|
||||
thread::sleep(Duration::from_millis(1));
|
||||
}
|
||||
}
|
||||
None
|
||||
@@ -105,10 +105,7 @@ impl AcpiGedDevice {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn notify(
|
||||
&mut self,
|
||||
notification_type: AcpiNotificationFlags,
|
||||
) -> Result<(), std::io::Error> {
|
||||
pub fn notify(&mut self, notification_type: AcpiNotificationFlags) -> io::Result<()> {
|
||||
self.notification_type |= notification_type;
|
||||
self.interrupt.trigger(0)
|
||||
}
|
||||
@@ -238,7 +235,7 @@ impl Default for AcpiPmTimerDevice {
|
||||
|
||||
impl BusDevice for AcpiPmTimerDevice {
|
||||
fn read(&mut self, _base: u64, _offset: u64, data: &mut [u8]) {
|
||||
if data.len() != std::mem::size_of::<u32>() {
|
||||
if data.len() != mem::size_of::<u32>() {
|
||||
warn!("Invalid sized read of PM timer: {}", data.len());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user