mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-04 19:11:11 +00:00
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 <robert.bradford@intel.com>
This commit is contained in:
parent
e294688904
commit
3c6dfd7709
@ -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,
|
||||
|
@ -123,7 +123,7 @@ pub enum ValidationError {
|
||||
InvalidHugePageSize(u64),
|
||||
// CPU Hotplug not permitted with TDX
|
||||
#[cfg(feature = "tdx")]
|
||||
TdxNoCPUHotplug,
|
||||
TdxNoCpuHotplug,
|
||||
}
|
||||
|
||||
type ValidationResult<T> = std::result::Result<T, ValidationError>;
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<T> = result::Result<T, Error>;
|
||||
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user