mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: plumb legacy SMBIOS config
Add a small SMBIOS config that carries serial_number, uuid, and OEM strings, and pass it from platform config into x86_64 setup. On-behalf-of: SAP leander.kohler@sap.com Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
This commit is contained in:
committed by
Rob Bradford
parent
0141635a5c
commit
e097d7d495
@@ -149,6 +149,21 @@ pub struct PlatformConfig {
|
||||
pub vfio_p2p_dma: bool,
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
impl PlatformConfig {
|
||||
/// Returns `None` if no SMBIOS-relevant platform fields are set, otherwise
|
||||
/// `Some` with a [`SmbiosConfig`] built from the populated fields.
|
||||
pub fn smbios_config(&self) -> Option<arch::x86_64::SmbiosConfig> {
|
||||
let smbios = arch::x86_64::SmbiosConfig {
|
||||
serial_number: self.serial_number.clone(),
|
||||
uuid: self.uuid.clone(),
|
||||
oem_strings: self.oem_strings.clone().unwrap_or_default(),
|
||||
};
|
||||
|
||||
(!smbios.is_empty()).then_some(smbios)
|
||||
}
|
||||
}
|
||||
|
||||
pub const DEFAULT_PCI_SEGMENT_APERTURE_WEIGHT: u32 = 1;
|
||||
|
||||
fn default_pci_segment_aperture_weight() -> u32 {
|
||||
|
||||
Reference in New Issue
Block a user