mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: clippy: add uninlined_format_args
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
7cb73e9e56
commit
ea4f07d3bf
@@ -757,7 +757,7 @@ impl ApiAction for VmCoredump {
|
||||
response_sender: Sender<ApiResponse>,
|
||||
) -> ApiRequest {
|
||||
Box::new(move |vmm| {
|
||||
info!("API request event: VmCoredump {:?}", coredump_data);
|
||||
info!("API request event: VmCoredump {coredump_data:?}");
|
||||
|
||||
let response = vmm
|
||||
.vm_coredump(&coredump_data.destination_url)
|
||||
|
||||
@@ -1266,7 +1266,7 @@ impl CpuManager {
|
||||
warn!("TDG_VP_VMCALL_SETUP_EVENT_NOTIFY_INTERRUPT not supported")
|
||||
}
|
||||
},
|
||||
Err(e) => error!("Unexpected TDX VMCALL: {}", e),
|
||||
Err(e) => error!("Unexpected TDX VMCALL: {e}"),
|
||||
}
|
||||
vcpu.vcpu.set_tdx_status(TdxExitStatus::InvalidOperand);
|
||||
}
|
||||
@@ -1922,7 +1922,7 @@ impl CpuManager {
|
||||
// or low (0x000xxx...).
|
||||
let high_range = extract_bits_64!(gva, 55, 1);
|
||||
if high_range == 0 {
|
||||
info!("VA (0x{:x}) range is not supported!", gva);
|
||||
info!("VA (0x{gva:x}) range is not supported!");
|
||||
return Ok(gva);
|
||||
}
|
||||
|
||||
|
||||
@@ -3447,7 +3447,7 @@ impl DeviceManager {
|
||||
let (pci_segment_id, pci_device_bdf, resources) =
|
||||
self.pci_resources(&id, pci_segment_id)?;
|
||||
|
||||
info!("Creating pvmemcontrol device: id = {}", id);
|
||||
info!("Creating pvmemcontrol device: id = {id}");
|
||||
let (pvmemcontrol_pci_device, pvmemcontrol_bus_device) =
|
||||
devices::pvmemcontrol::PvmemcontrolDevice::make_device(
|
||||
id.clone(),
|
||||
@@ -4222,7 +4222,7 @@ impl DeviceManager {
|
||||
) -> DeviceManagerResult<Option<Arc<Mutex<devices::IvshmemDevice>>>> {
|
||||
let id = String::from(IVSHMEM_DEVICE_NAME);
|
||||
let pci_segment_id = 0x0_u16;
|
||||
info!("Creating ivshmem device {}", id);
|
||||
info!("Creating ivshmem device {id}");
|
||||
|
||||
let (pci_segment_id, pci_device_bdf, resources) =
|
||||
self.pci_resources(&id, pci_segment_id)?;
|
||||
@@ -4982,7 +4982,7 @@ impl IvshmemOps for IvshmemHandler {
|
||||
size: usize,
|
||||
backing_file: Option<PathBuf>,
|
||||
) -> Result<(Arc<GuestRegionMmap>, UserspaceMapping), IvshmemError> {
|
||||
info!("Creating ivshmem mem region at 0x{:x}", start_addr);
|
||||
info!("Creating ivshmem mem region at 0x{start_addr:x}");
|
||||
|
||||
let region = MemoryManager::create_ram_region(
|
||||
&backing_file,
|
||||
|
||||
@@ -223,11 +223,11 @@ impl MultiThreadBase for GdbStub {
|
||||
Ok(())
|
||||
}
|
||||
Ok(s) => {
|
||||
error!("Unexpected response for ReadRegs: {:?}", s);
|
||||
error!("Unexpected response for ReadRegs: {s:?}");
|
||||
Err(TargetError::NonFatal)
|
||||
}
|
||||
Err(e) => {
|
||||
error!("Failed to request ReadRegs: {:?}", e);
|
||||
error!("Failed to request ReadRegs: {e:?}");
|
||||
Err(TargetError::NonFatal)
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ impl MultiThreadBase for GdbStub {
|
||||
) {
|
||||
Ok(_) => Ok(()),
|
||||
Err(e) => {
|
||||
error!("Failed to request WriteRegs: {:?}", e);
|
||||
error!("Failed to request WriteRegs: {e:?}");
|
||||
Err(TargetError::NonFatal)
|
||||
}
|
||||
}
|
||||
@@ -267,11 +267,11 @@ impl MultiThreadBase for GdbStub {
|
||||
Ok(std::cmp::min(data.len(), r.len()))
|
||||
}
|
||||
Ok(s) => {
|
||||
error!("Unexpected response for ReadMem: {:?}", s);
|
||||
error!("Unexpected response for ReadMem: {s:?}");
|
||||
Err(TargetError::NonFatal)
|
||||
}
|
||||
Err(e) => {
|
||||
error!("Failed to request ReadMem: {:?}", e);
|
||||
error!("Failed to request ReadMem: {e:?}");
|
||||
Err(TargetError::NonFatal)
|
||||
}
|
||||
}
|
||||
@@ -289,7 +289,7 @@ impl MultiThreadBase for GdbStub {
|
||||
) {
|
||||
Ok(_) => Ok(()),
|
||||
Err(e) => {
|
||||
error!("Failed to request WriteMem: {:?}", e);
|
||||
error!("Failed to request WriteMem: {e:?}");
|
||||
Err(TargetError::NonFatal)
|
||||
}
|
||||
}
|
||||
@@ -414,7 +414,7 @@ impl HwBreakpoint for GdbStub {
|
||||
match self.vm_request(payload, 0) {
|
||||
Ok(_) => Ok(true),
|
||||
Err(e) => {
|
||||
error!("Failed to request SetHwBreakPoint: {:?}", e);
|
||||
error!("Failed to request SetHwBreakPoint: {e:?}");
|
||||
Err(TargetError::NonFatal)
|
||||
}
|
||||
}
|
||||
@@ -433,7 +433,7 @@ impl HwBreakpoint for GdbStub {
|
||||
match self.vm_request(payload, 0) {
|
||||
Ok(_) => Ok(true),
|
||||
Err(e) => {
|
||||
error!("Failed to request SetHwBreakPoint: {:?}", e);
|
||||
error!("Failed to request SetHwBreakPoint: {e:?}");
|
||||
Err(TargetError::NonFatal)
|
||||
}
|
||||
}
|
||||
@@ -498,7 +498,7 @@ impl run_blocking::BlockingEventLoop for GdbEventLoop {
|
||||
target
|
||||
.vm_request(GdbRequestPayload::Pause, 0)
|
||||
.map_err(|e| {
|
||||
error!("Failed to pause the target: {:?}", e);
|
||||
error!("Failed to pause the target: {e:?}");
|
||||
"Failed to pause the target"
|
||||
})?;
|
||||
Ok(Some(MultiThreadStopReason::Signal(Signal::SIGINT)))
|
||||
@@ -509,7 +509,7 @@ pub fn gdb_thread(mut gdbstub: GdbStub, path: &std::path::Path) {
|
||||
let listener = match UnixListener::bind(path) {
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
error!("Failed to create a Unix domain socket listener: {}", e);
|
||||
error!("Failed to create a Unix domain socket listener: {e}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
@@ -518,11 +518,11 @@ pub fn gdb_thread(mut gdbstub: GdbStub, path: &std::path::Path) {
|
||||
let (stream, addr) = match listener.accept() {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
error!("Failed to accept a connection from GDB: {}", e);
|
||||
error!("Failed to accept a connection from GDB: {e}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
info!("GDB connected from {:?}", addr);
|
||||
info!("GDB connected from {addr:?}");
|
||||
|
||||
let connection: Box<dyn ConnectionExt<Error = std::io::Error>> = Box::new(stream);
|
||||
let gdb = gdbstub::stub::GdbStub::new(connection);
|
||||
@@ -533,17 +533,17 @@ pub fn gdb_thread(mut gdbstub: GdbStub, path: &std::path::Path) {
|
||||
info!("GDB client has disconnected. Running...");
|
||||
|
||||
if let Err(e) = gdbstub.vm_request(GdbRequestPayload::SetSingleStep(false), 0) {
|
||||
error!("Failed to disable single step: {:?}", e);
|
||||
error!("Failed to disable single step: {e:?}");
|
||||
}
|
||||
|
||||
if let Err(e) =
|
||||
gdbstub.vm_request(GdbRequestPayload::SetHwBreakPoint(Vec::new()), 0)
|
||||
{
|
||||
error!("Failed to remove breakpoints: {:?}", e);
|
||||
error!("Failed to remove breakpoints: {e:?}");
|
||||
}
|
||||
|
||||
if let Err(e) = gdbstub.vm_request(GdbRequestPayload::Resume, 0) {
|
||||
error!("Failed to resume the VM: {:?}", e);
|
||||
error!("Failed to resume the VM: {e:?}");
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
@@ -551,7 +551,7 @@ pub fn gdb_thread(mut gdbstub: GdbStub, path: &std::path::Path) {
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
error!("error occurred in GDB session: {}", e);
|
||||
error!("error occurred in GDB session: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ impl InterruptSourceGroup for LegacyUserspaceInterruptGroup {
|
||||
.lock()
|
||||
.unwrap()
|
||||
.service_irq(self.irq as usize)
|
||||
.map_err(|e| io::Error::other(format!("failed to inject IRQ #{}: {:?}", self.irq, e)))
|
||||
.map_err(|e| io::Error::other(format!("failed to inject IRQ #{}: {e:?}", self.irq)))
|
||||
}
|
||||
|
||||
fn update(
|
||||
|
||||
@@ -945,7 +945,7 @@ impl Vmm {
|
||||
})?;
|
||||
#[cfg(feature = "guest_debug")]
|
||||
let debug_evt = self.vm_debug_evt.try_clone().map_err(|e| {
|
||||
MigratableError::MigrateReceive(anyhow!("Error cloning debug EventFd: {}", e))
|
||||
MigratableError::MigrateReceive(anyhow!("Error cloning debug EventFd: {e}"))
|
||||
})?;
|
||||
let activate_evt = self.activate_evt.try_clone().map_err(|e| {
|
||||
MigratableError::MigrateReceive(anyhow!("Error cloning activate EventFd: {e}"))
|
||||
|
||||
@@ -2074,7 +2074,7 @@ impl MemoryManager {
|
||||
}
|
||||
}
|
||||
|
||||
debug!("coredump total bytes {}", total_bytes);
|
||||
debug!("coredump total bytes {total_bytes}");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ pub fn url_to_file(url: &str) -> std::result::Result<PathBuf, GuestDebuggableErr
|
||||
let file: PathBuf = url
|
||||
.strip_prefix("file://")
|
||||
.ok_or_else(|| {
|
||||
GuestDebuggableError::Coredump(anyhow!("Could not extract file from URL: {}", url))
|
||||
GuestDebuggableError::Coredump(anyhow!("Could not extract file from URL: {url}"))
|
||||
})
|
||||
.map(|s| s.into())?;
|
||||
|
||||
|
||||
@@ -2072,13 +2072,12 @@ impl Vm {
|
||||
// No need to allocate if the section falls within guest RAM ranges
|
||||
if boot_guest_memory.address_in_range(GuestAddress(section.address)) {
|
||||
info!(
|
||||
"Not allocating TDVF Section: {:x?} since it is already part of guest RAM",
|
||||
section
|
||||
"Not allocating TDVF Section: {section:x?} since it is already part of guest RAM"
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
info!("Allocating TDVF Section: {:x?}", section);
|
||||
info!("Allocating TDVF Section: {section:x?}");
|
||||
self.memory_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
@@ -2106,7 +2105,7 @@ impl Vm {
|
||||
let mut payload_info = None;
|
||||
let mut hob_offset = None;
|
||||
for section in sections {
|
||||
info!("Populating TDVF Section: {:x?}", section);
|
||||
info!("Populating TDVF Section: {section:x?}");
|
||||
match section.r#type {
|
||||
TdvfSectionType::Bfv | TdvfSectionType::Cfv => {
|
||||
info!("Copying section to guest memory");
|
||||
|
||||
Reference in New Issue
Block a user