mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: Use variables directly in format! string
Fix clippy warning `uninlined_format_args` reported by rustc rustc
1.89.0 (29483883e 2025-08-04).
```console
warning: variables can be used directly in the `format!` string
--> block/src/lib.rs:649:17
|
649 | info!("{} failed to create io_uring instance: {}", error_msg, e);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
= note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
|
649 - info!("{} failed to create io_uring instance: {}", error_msg, e);
649 + info!("{error_msg} failed to create io_uring instance: {e}");
|
```
Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
committed by
cloud-hypervisor-bot
parent
ea83fe314c
commit
f2dfa7f6e0
@@ -633,7 +633,7 @@ impl vm::Vm for KvmVm {
|
||||
///
|
||||
fn create_vaia(&self, config: VaiaConfig) -> vm::Result<Arc<Mutex<dyn Vaia>>> {
|
||||
let aia_device = KvmAiaImsics::new(self, config)
|
||||
.map_err(|e| vm::HypervisorVmError::CreateVaia(anyhow!("Vaia error {:?}", e)))?;
|
||||
.map_err(|e| vm::HypervisorVmError::CreateVaia(anyhow!("Vaia error {e:?}")))?;
|
||||
Ok(Arc::new(Mutex::new(aia_device)))
|
||||
}
|
||||
|
||||
@@ -1997,8 +1997,7 @@ impl cpu::Vcpu for KvmVcpu {
|
||||
// tr.valid is set if the GVA is mapped to valid GPA.
|
||||
match tr.valid {
|
||||
0 => Err(cpu::HypervisorCpuError::TranslateVirtualAddress(anyhow!(
|
||||
"Invalid GVA: {:#x}",
|
||||
gva
|
||||
"Invalid GVA: {gva:#x}"
|
||||
))),
|
||||
_ => Ok((tr.physical_address, 0)),
|
||||
}
|
||||
@@ -2081,16 +2080,14 @@ impl cpu::Vcpu for KvmVcpu {
|
||||
VcpuExit::Debug(_) => Ok(cpu::VmExit::Debug),
|
||||
|
||||
r => Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(
|
||||
"Unexpected exit reason on vcpu run: {:?}",
|
||||
r
|
||||
"Unexpected exit reason on vcpu run: {r:?}"
|
||||
))),
|
||||
},
|
||||
|
||||
Err(ref e) => match e.errno() {
|
||||
libc::EAGAIN | libc::EINTR => Ok(cpu::VmExit::Ignore),
|
||||
_ => Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(
|
||||
"VCPU error {:?}",
|
||||
e
|
||||
"VCPU error {e:?}"
|
||||
))),
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user