mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-19 07:49:17 +00:00
kata-types: Clean up noise caused by unformatted code
For a long time, there has been unformatted code in the kata-types codebase, for example: ``` if qemu.memory_info.enable_guest_swap { - return Err(eother!( - "Qemu hypervisor doesn't support enable_guest_swap" - )); + return Err(eother!("Qemu hypervisor doesn't support enable_guest_swap")); } ... - }, device::DRIVER_NVDIMM_TYPE, eother, resolve_path + }, + device::DRIVER_NVDIMM_TYPE, + eother, resolve_path, -use std::collections::HashMap; -use anyhow::{Result, anyhow}; +use anyhow::{anyhow, Result}; use std::collections::hash_map::Entry; +use std::collections::HashMap; -/// DRIVER_VFIO_PCI_GK_TYPE is the device driver for vfio-pci +/// DRIVER_VFIO_PCI_GK_TYPE is the device driver for vfio-pci ``` This has brought unnecessary difficulties in version maintenance and commit difficulties. This commit will address this issue. Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
@@ -119,7 +119,9 @@ impl ConfigPlugin for QemuConfig {
|
|||||||
}
|
}
|
||||||
if qemu.boot_info.image.is_empty() && qemu.boot_info.initrd.is_empty() {
|
if qemu.boot_info.image.is_empty() && qemu.boot_info.initrd.is_empty() {
|
||||||
// IBM SE (CCW + confidential guest) does not require neither image nor initrd.
|
// IBM SE (CCW + confidential guest) does not require neither image nor initrd.
|
||||||
if !(qemu.boot_info.vm_rootfs_driver.ends_with("ccw") && qemu.security_info.confidential_guest) {
|
if !(qemu.boot_info.vm_rootfs_driver.ends_with("ccw")
|
||||||
|
&& qemu.security_info.confidential_guest)
|
||||||
|
{
|
||||||
return Err(eother!(
|
return Err(eother!(
|
||||||
"Both guest boot image and initrd for qemu are empty"
|
"Both guest boot image and initrd for qemu are empty"
|
||||||
));
|
));
|
||||||
@@ -151,9 +153,7 @@ impl ConfigPlugin for QemuConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if qemu.memory_info.enable_guest_swap {
|
if qemu.memory_info.enable_guest_swap {
|
||||||
return Err(eother!(
|
return Err(eother!("Qemu hypervisor doesn't support enable_guest_swap"));
|
||||||
"Qemu hypervisor doesn't support enable_guest_swap"
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,7 +13,9 @@ use crate::{
|
|||||||
config::{
|
config::{
|
||||||
default::{self, MAX_REMOTE_VCPUS, MIN_REMOTE_MEMORY_SIZE_MB},
|
default::{self, MAX_REMOTE_VCPUS, MIN_REMOTE_MEMORY_SIZE_MB},
|
||||||
ConfigPlugin,
|
ConfigPlugin,
|
||||||
}, device::DRIVER_NVDIMM_TYPE, eother, resolve_path
|
},
|
||||||
|
device::DRIVER_NVDIMM_TYPE,
|
||||||
|
eother, resolve_path,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::register_hypervisor_plugin;
|
use super::register_hypervisor_plugin;
|
||||||
|
@@ -3,9 +3,9 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use anyhow::{anyhow, Result};
|
||||||
use anyhow::{Result, anyhow};
|
|
||||||
use std::collections::hash_map::Entry;
|
use std::collections::hash_map::Entry;
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
/// Generic manager to manage registered handlers.
|
/// Generic manager to manage registered handlers.
|
||||||
pub struct HandlerManager<H> {
|
pub struct HandlerManager<H> {
|
||||||
|
Reference in New Issue
Block a user