misc: Fix various clippy issues

Signed-off-by: Bo Chen <chen.bo@intel.com>

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen
2024-01-09 14:56:30 -08:00
committed by Bo Chen
parent 3d3693699b
commit b665aa19f4
15 changed files with 32 additions and 46 deletions

View File

@@ -1148,7 +1148,7 @@ impl CpuManager {
fn remove_vcpu(&mut self, cpu_id: u8) -> Result<()> {
info!("Removing vCPU: cpu_id = {}", cpu_id);
let mut state = &mut self.vcpu_states[usize::from(cpu_id)];
let state = &mut self.vcpu_states[usize::from(cpu_id)];
state.kill.store(true, Ordering::SeqCst);
state.signal_thread();
state.join_thread()?;

View File

@@ -1506,7 +1506,7 @@ impl MemoryManager {
.ok_or(Error::MemoryRangeAllocation)?;
// Update the slot so that it can be queried via the I/O port
let mut slot = &mut self.hotplug_slots[self.next_hotplug_slot];
let slot = &mut self.hotplug_slots[self.next_hotplug_slot];
slot.active = true;
slot.inserting = true;
slot.base = region.start_addr().0;

View File

@@ -225,7 +225,7 @@ impl SerialManager {
const EPOLL_EVENTS_LEN: usize = 3;
let mut events =
vec![epoll::Event::new(epoll::Events::empty(), 0); EPOLL_EVENTS_LEN];
[epoll::Event::new(epoll::Events::empty(), 0); EPOLL_EVENTS_LEN];
loop {
let num_events = match epoll::wait(epoll_fd, timeout, &mut events[..]) {

View File

@@ -1319,7 +1319,7 @@ impl Vm {
.resize(desired_memory)
.map_err(Error::MemoryManager)?;
let mut memory_config = &mut self.config.lock().unwrap().memory;
let memory_config = &mut self.config.lock().unwrap().memory;
if let Some(new_region) = &new_region {
self.device_manager