misc: clippy: remove some overrides
Closes #4986 [0]. [0]: https://github.com/cloud-hypervisor/cloud-hypervisor/issues/4986 Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
parent
a8d1411307
commit
82e8002fa0
4 changed files with 11 additions and 19 deletions
|
|
@ -487,8 +487,7 @@ fn create_app(default_vcpus: String, default_memory: String, default_rng: String
|
|||
.args(args)
|
||||
}
|
||||
|
||||
#[allow(clippy::needless_pass_by_value)]
|
||||
fn start_vmm(cmd_arguments: ArgMatches) -> Result<Option<String>, Error> {
|
||||
fn start_vmm(cmd_arguments: &ArgMatches) -> Result<Option<String>, Error> {
|
||||
let log_level = match cmd_arguments.get_count("v") {
|
||||
0 => LevelFilter::Warn,
|
||||
1 => LevelFilter::Info,
|
||||
|
|
@ -724,7 +723,7 @@ fn start_vmm(cmd_arguments: ArgMatches) -> Result<Option<String>, Error> {
|
|||
cmd_arguments.contains_id("kernel") || cmd_arguments.contains_id("firmware");
|
||||
|
||||
if payload_present {
|
||||
let vm_params = VmParams::from_arg_matches(&cmd_arguments);
|
||||
let vm_params = VmParams::from_arg_matches(cmd_arguments);
|
||||
let vm_config = VmConfig::parse(vm_params).map_err(Error::ParsingConfig)?;
|
||||
|
||||
// Create and boot the VM based off the VM config we just built.
|
||||
|
|
@ -886,7 +885,7 @@ fn main() {
|
|||
warn!("Error expanding FD table: {e}");
|
||||
}
|
||||
|
||||
let exit_code = match start_vmm(cmd_arguments) {
|
||||
let exit_code = match start_vmm(&cmd_arguments) {
|
||||
Ok(path) => {
|
||||
path.map(|s| std::fs::remove_file(s).ok());
|
||||
info!("Cloud Hypervisor exited successfully");
|
||||
|
|
|
|||
|
|
@ -417,7 +417,6 @@ impl VsockPacket {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::undocumented_unsafe_blocks)]
|
||||
mod unit_tests {
|
||||
use virtio_bindings::virtio_ring::VRING_DESC_F_WRITE;
|
||||
use virtio_queue::QueueOwnedT;
|
||||
|
|
@ -465,8 +464,9 @@ mod unit_tests {
|
|||
let hdr_gpa = guest_desc.addr.get();
|
||||
let hdr_ptr =
|
||||
get_host_address_range(mem, GuestAddress(hdr_gpa), VSOCK_PKT_HDR_SIZE).unwrap();
|
||||
// SAFETY: The length is valid.
|
||||
let len_ptr = unsafe { hdr_ptr.add(HDROFF_LEN) };
|
||||
|
||||
// SAFETY: The length is valid.
|
||||
LittleEndian::write_u32(unsafe { std::slice::from_raw_parts_mut(len_ptr, 4) }, len);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -304,7 +304,6 @@ mod unit_tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::redundant_clone)]
|
||||
fn bus_read_write() {
|
||||
let bus = Bus::new();
|
||||
let dummy = Arc::new(DummyDevice);
|
||||
|
|
@ -322,7 +321,6 @@ mod unit_tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::redundant_clone)]
|
||||
fn bus_read_write_values() {
|
||||
let bus = Bus::new();
|
||||
let dummy = Arc::new(ConstantDevice);
|
||||
|
|
@ -338,7 +336,6 @@ mod unit_tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::redundant_clone)]
|
||||
fn busrange_cmp() {
|
||||
let range = BusRange { base: 0x10, len: 2 };
|
||||
assert_eq!(range, BusRange { base: 0x10, len: 3 });
|
||||
|
|
|
|||
|
|
@ -1235,12 +1235,10 @@ impl Vmm {
|
|||
Ok(true)
|
||||
}
|
||||
|
||||
#[allow(clippy::needless_pass_by_value)]
|
||||
fn send_migration(
|
||||
vm: &mut Vm,
|
||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))] hypervisor: Arc<
|
||||
dyn hypervisor::Hypervisor,
|
||||
>,
|
||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||
hypervisor: &dyn hypervisor::Hypervisor,
|
||||
send_data_migration: &VmSendMigrationData,
|
||||
) -> result::Result<(), MigratableError> {
|
||||
// Set up the socket connection
|
||||
|
|
@ -1265,12 +1263,10 @@ impl Vmm {
|
|||
}
|
||||
|
||||
let amx = vm_config.lock().unwrap().cpus.features.amx;
|
||||
let phys_bits = vm::physical_bits(
|
||||
hypervisor.as_ref(),
|
||||
vm_config.lock().unwrap().cpus.max_phys_bits,
|
||||
);
|
||||
let phys_bits =
|
||||
vm::physical_bits(hypervisor, vm_config.lock().unwrap().cpus.max_phys_bits);
|
||||
arch::generate_common_cpuid(
|
||||
hypervisor.as_ref(),
|
||||
hypervisor,
|
||||
&arch::CpuidConfig {
|
||||
phys_bits,
|
||||
kvm_hyperv: vm_config.lock().unwrap().cpus.kvm_hyperv,
|
||||
|
|
@ -2323,7 +2319,7 @@ impl RequestHandler for Vmm {
|
|||
Self::send_migration(
|
||||
vm,
|
||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||
self.hypervisor.clone(),
|
||||
self.hypervisor.as_ref(),
|
||||
&send_data_migration,
|
||||
)
|
||||
.map_err(|migration_err| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue