vmm: unrelated small code improvements

Unfortunately, there is no lint for that.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
Philipp Schuster
2025-11-20 09:55:05 +01:00
committed by Rob Bradford
parent fed010fcd1
commit f02745a7ed

View File

@@ -1874,9 +1874,8 @@ impl RequestHandler for Vmm {
}
if let Some(ref mut vm) = self.vm {
let info = vm.add_device(device_cfg).map_err(|e| {
let info = vm.add_device(device_cfg).inspect_err(|e| {
error!("Error when adding new device to the VM: {e:?}");
e
})?;
serde_json::to_vec(&info)
.map(Some)
@@ -1903,9 +1902,8 @@ impl RequestHandler for Vmm {
}
if let Some(ref mut vm) = self.vm {
let info = vm.add_user_device(device_cfg).map_err(|e| {
let info = vm.add_user_device(device_cfg).inspect_err(|e| {
error!("Error when adding new user device to the VM: {e:?}");
e
})?;
serde_json::to_vec(&info)
.map(Some)