From 3c6dfd7709147daf343215be7b8ced58b6464ac5 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 25 Mar 2021 17:01:21 +0000 Subject: [PATCH] tdx: Address Rust 1.51.0 clippy issue (upper_case_acroynms) error: name `FinalizeTDX` contains a capitalized acronym --> vmm/src/vm.rs:274:5 | 274 | FinalizeTDX(hypervisor::HypervisorVmError), | ^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `FinalizeTdx` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms Signed-off-by: Rob Bradford --- hypervisor/src/kvm/mod.rs | 6 +++--- vmm/src/config.rs | 6 +++--- vmm/src/vm.rs | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 985ea9ad1..18b894fed 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -369,7 +369,7 @@ impl vm::Vm for KvmVm { reserved: u32, attributes: u64, cpuid: u64, - }; + } let data = TdxInitVm { max_vcpus, reserved: 0, @@ -411,7 +411,7 @@ impl vm::Vm for KvmVm { host_address: u64, guest_address: u64, pages: u64, - }; + } let data = TdxInitMemRegion { host_address, guest_address, @@ -440,7 +440,7 @@ fn tdx_command( command: TdxCommand, metadata: u32, data: u64, - }; + } let cmd = TdxIoctlCmd { command, metadata, diff --git a/vmm/src/config.rs b/vmm/src/config.rs index c601e714b..8725f663b 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -123,7 +123,7 @@ pub enum ValidationError { InvalidHugePageSize(u64), // CPU Hotplug not permitted with TDX #[cfg(feature = "tdx")] - TdxNoCPUHotplug, + TdxNoCpuHotplug, } type ValidationResult = std::result::Result; @@ -160,7 +160,7 @@ impl fmt::Display for ValidationError { write!(f, "Huge page size is not power of 2: {}", s) } #[cfg(feature = "tdx")] - TdxNoCPUHotplug => { + TdxNoCpuHotplug => { write!(f, "CPU hotplug not possible with TDX") } } @@ -1612,7 +1612,7 @@ impl VmConfig { return Err(ValidationError::KernelMissing); } if tdx_enabled && (self.cpus.max_vcpus != self.cpus.boot_vcpus) { - return Err(ValidationError::TdxNoCPUHotplug); + return Err(ValidationError::TdxNoCpuHotplug); } } diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 3c0e88ede..d4dbcb64e 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -263,15 +263,15 @@ pub enum Error { /// Error enabling TDX VM #[cfg(feature = "tdx")] - InitializeTDXVM(hypervisor::HypervisorVmError), + InitializeTdxVm(hypervisor::HypervisorVmError), /// Error enabling TDX memory region #[cfg(feature = "tdx")] - InitializeTDXMemoryRegion(hypervisor::HypervisorVmError), + InitializeTdxMemoryRegion(hypervisor::HypervisorVmError), /// Error finalizing TDX setup #[cfg(feature = "tdx")] - FinalizeTDX(hypervisor::HypervisorVmError), + FinalizeTdx(hypervisor::HypervisorVmError), } pub type Result = result::Result; @@ -1552,7 +1552,7 @@ impl Vm { let max_vcpus = self.cpu_manager.lock().unwrap().max_vcpus() as u32; self.vm .tdx_init(&cpuid, max_vcpus) - .map_err(Error::InitializeTDXVM)?; + .map_err(Error::InitializeTdxVm)?; Ok(()) } @@ -1669,7 +1669,7 @@ impl Vm { /* TDVF_SECTION_ATTRIBUTES_EXTENDMR */ section.attributes == 1, ) - .map_err(Error::InitializeTDXMemoryRegion)?; + .map_err(Error::InitializeTdxMemoryRegion)?; } Ok(hob_offset) @@ -1729,7 +1729,7 @@ impl Vm { .initialize_tdx(hob_address) .map_err(Error::CpuManager)?; // With TDX memory and CPU state configured TDX setup is complete - self.vm.tdx_finalize().map_err(Error::FinalizeTDX)?; + self.vm.tdx_finalize().map_err(Error::FinalizeTdx)?; } self.cpu_manager