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:
Ruoqing He
2025-09-23 15:07:13 +00:00
committed by cloud-hypervisor-bot
parent ea83fe314c
commit f2dfa7f6e0
56 changed files with 470 additions and 679 deletions
+6 -7
View File
@@ -81,7 +81,7 @@ impl Blk {
config,
paused,
) = if let Some(state) = state {
info!("Restoring vhost-user-block {}", id);
info!("Restoring vhost-user-block {id}");
vu.set_protocol_features_vhost_user(
state.acked_features,
@@ -135,8 +135,7 @@ impl Blk {
if num_queues > backend_num_queues {
error!(
"vhost-user-blk requested too many queues ({}) since the backend only supports {}\n",
num_queues, backend_num_queues
"vhost-user-blk requested too many queues ({num_queues}) since the backend only supports {backend_num_queues}\n"
);
return Err(Error::BadQueueNum);
}
@@ -216,13 +215,13 @@ impl Drop for Blk {
if let Some(kill_evt) = self.common.kill_evt.take()
&& let Err(e) = kill_evt.write(1)
{
error!("failed to kill vhost-user-blk: {:?}", e);
error!("failed to kill vhost-user-blk: {e:?}");
}
self.common.wait_for_epoll_threads();
if let Some(thread) = self.epoll_thread.take()
&& let Err(e) = thread.join()
{
error!("Error joining thread: {:?}", e);
error!("Error joining thread: {e:?}");
}
}
}
@@ -275,7 +274,7 @@ impl VirtioDevice for Blk {
.set_config(offset as u32, VhostUserConfigFlags::WRITABLE, data)
.map_err(Error::VhostUserSetConfig)
{
error!("Failed setting vhost-user-blk configuration: {:?}", e);
error!("Failed setting vhost-user-blk configuration: {e:?}");
}
}
@@ -331,7 +330,7 @@ impl VirtioDevice for Blk {
if let Some(vu) = &self.vu_common.vu
&& let Err(e) = vu.lock().unwrap().reset_vhost_user()
{
error!("Failed to reset vhost-user daemon: {:?}", e);
error!("Failed to reset vhost-user daemon: {e:?}");
return None;
}