vmm: provide oem_strings option

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2022-08-05 13:11:18 +00:00
committed by Rob Bradford
parent 964985bb5c
commit 57e9b80123
4 changed files with 32 additions and 3 deletions

View File

@@ -820,14 +820,15 @@ pub fn configure_system(
sgx_epc_region: Option<SgxEpcRegion>,
serial_number: Option<&str>,
uuid: Option<&str>,
oem_strings: Option<&[&str]>,
) -> super::Result<()> {
// Write EBDA address to location where ACPICA expects to find it
guest_mem
.write_obj((layout::EBDA_START.0 >> 4) as u16, layout::EBDA_POINTER)
.map_err(Error::EbdaSetup)?;
let size =
smbios::setup_smbios(guest_mem, serial_number, uuid, None).map_err(Error::SmbiosSetup)?;
let size = smbios::setup_smbios(guest_mem, serial_number, uuid, oem_strings)
.map_err(Error::SmbiosSetup)?;
// Place the MP table after the SMIOS table aligned to 16 bytes
let offset = GuestAddress(layout::SMBIOS_START).unchecked_add(size);
@@ -1181,6 +1182,7 @@ mod tests {
None,
None,
None,
None,
);
assert!(config_err.is_err());
@@ -1203,6 +1205,7 @@ mod tests {
None,
None,
None,
None,
)
.unwrap();
@@ -1224,6 +1227,7 @@ mod tests {
None,
None,
None,
None,
)
.unwrap();
@@ -1236,6 +1240,7 @@ mod tests {
None,
None,
None,
None,
)
.unwrap();
@@ -1257,6 +1262,7 @@ mod tests {
None,
None,
None,
None,
)
.unwrap();
@@ -1269,6 +1275,7 @@ mod tests {
None,
None,
None,
None,
)
.unwrap();
}